Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
D

debnarayan

@debnarayan
About
Posts
9
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Updating live/running Stored Procedures / Functions
    D debnarayan

    Hi, My application requires certain reporting queries to be totally dynamically determined from application level. What I have done [rather, am doing] is build the query as indicated from UI and store it as a SP in the database. The confusion is, say, someone is running the reporting SP, [which takes around 30 secs time to get executed and start returning data], and at the same time someone else trigerred an Alter on the SP. I do not want any one to get an exception, not even a timeout. So what I have planned is to have a list of the dynamic SP's in DB table, and indicate by a flag, whether it is in use, or not, also whether it is further callable or not. So we can effectively give proper messages instead of exception, if any [I actually do not know, whether there will be an exception] So, my questions are: 1. What happens when someone calls for an Alter script on a SP while it is running 2. What if, due to some problem, like a connection drop or something, the running query stops executing. As the flags are shared, I cannot run these on a transaction. Essentially, I do not know what happens when the connection over which the query is invoked gets dropped midway in execution. Does the query stop executing, raising an error, or does it complete the execution, and stop silently? Thanks in advance

    Database database help sharepoint design tools

  • File System access seems to fail from VS 2005 add-in
    D debnarayan

    Hi, I am working on a Visual Studio 2005 Add-In, which runs a Win-Form application to gather the data for it, and do other stuff. Later the add-in gathers certain info from the winform to open a solution file in the Visual Studio instance. Problem is[, rather are]: 1. There is a folder-browser dialog in the win-form, which is not displayed correctly. The folder list is not displayed at all. Looks like it cannot read the file-system 2. The win-form tries to save certain files to the system [to a folder pointed by user by the folder-dialog], which is failing [We have free-text area where we can type in the target folder name, if the browser does not work] This is happening on Vista machine [that's all that i have here] irrespective of UAC being turned on or off. Primary steps followed: 1. The winform app has to run by itself, and also from the add-in. So i hosted the win-form app in an AppDomain from the add-in. Also it has to be hosted in a separate thread, or else the form-closing signal [or that is what it seemed] was closing the Visual Studio window as well. 2. The win-form knows whether it is running from add-in or all by itself. Some string values are transferred from the add-in to the win-form and vice-versa via the AppDomain data storage. 3. As we are using Vista, the win-form as an independant application is made UAC aware, by the manifest file. So file system access is running great when i run the win-form independantly. Am i doing something wrong? Please guide...

    Visual Studio visual-studio csharp help tutorial question

  • Hosting App-Domain from Visual Studio - VS is Unloading silently
    D debnarayan

    Hi, I am trying to create a Visual Studio 2005 Add in, that should call an Winform application to gather some info from user. I have hosted the Form code in a new AppDomain and have obtained the required fields back via AppDomain.SetData and GetData methods. Problem is, VS is unloading silently, even if the WinForm did not throw any exception. Here is the code for the Exec method:

    public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
    {
    handled = false;
    if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
    {
    if(commandName == "TestVSAddIn.Connect.TestVSAddIn")
    {

                    AppDomain wizardDomain = null;
                    try
                    {
                        if (String.IsNullOrEmpty(this.applicationWizardAssemblyName) || !File.Exists(this.applicationWizardAssemblyName))
                            throw new InvalidOperationException("Installation error.");
    
                        if (wizardDomain == null)
                        {
                            AppDomainSetup wizardDomainSetup = new AppDomainSetup();
                            wizardDomainSetup.ApplicationBase = applicationWizardAssemblyPath;
                            wizardDomainSetup.PrivateBinPath = applicationWizardAssemblyPath;
                            wizardDomain = AppDomain.CreateDomain("WizardDomain", null, wizardDomainSetup);
    
                            wizardDomain.SetData("RunningFromVS", true);
                        }
    
                        wizardDomain.ExecuteAssembly(applicationWizardAssemblyName);
    
                        if (wizardDomain.GetData("OpenInVS") != null && wizardDomain.GetData("SolutionPath") != null)
                        {
                            bool openInVS = Convert.ToBoolean(wizardDomain.GetData("OpenInVS"));
                            string solutionPath = Convert.ToString(wizardDomain.GetData("SolutionPath"));
    
                            if (\_applicationObject.Solution.IsOpen)
                            {
                                \_applicationObject.Solution.Close(true);
                            }
    
                            \_applicationObject.Solution.Open(solutionPath);
                        }
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            Logger.LogThis("Error
    
    .NET (Core and Framework) visual-studio help csharp hosting

  • History of exception/error management
    D debnarayan

    I was wondering about exception handling mechanism lately. Few questions I could not find any answers to..... 1. How did Babbage did similar things in the analytical engine? Was this required? Or the large computing instruments with vaccuum valves? 2. What can be the exact sequence of evolution of such concept? [say unpredictable result >> predictable return values >> standardised hresult values >> exceptions]

    IT & Infrastructure help question

  • Cannot send all mails by SmtpClient.Send method until process is killed
    D debnarayan

    Hello all, I found an answer to my question. The bufferring is done by Norton Antivius Email-Scanner. The possible solutions I found from MSDN Blog is to set the SmtpClient.ServicePoint.MaxIdleTime = 1 or 60, etc and/or SmtpClient.ServicePoint.ConnectionLimit = 1, etc. Personally I tried with SmtpClient.TimeOut = 60 and 120 and that worked with certain TimeOut exceptions which I had to handle. Here are the link to the posts in MSDN: MSDN: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=164793&SiteID=1&PageID=1[^] Channel9: http://channel9.msdn.com/ShowPost.aspx?PostID=349773#349773[^]

    C# csharp help asp-net sysadmin testing

  • Cannot send all mails by SmtpClient.Send method until process is killed
    D debnarayan

    Yes, the app terminates after the Console.Read(). I am still in problem as SmtpClient class has no flush method. And I cannot Dispose off any client, as there is an implementation of client pooling. So I am creating the clients with identical credentials, and Host settings, and maintaining a queue of specified number of clients. I am thinking of recreating the client list after some idle time, but I am not sure. But is it really some buffer issue at the SmtpClient end, or at some other end? Because if it is at some other end, I am not sure whether disposing off the clients will flush it. And where is the buffer? Deb

    C# csharp help asp-net sysadmin testing

  • Cannot send all mails by SmtpClient.Send method until process is killed
    D debnarayan

    Yes, obviously writing a windows service is possible, but I need it as a WebService. However, I can use other approaches as well, but I need to send all the mails. As also, due to certain constraints, I can't use database, or even flat files for mail sending. I am using a derived Queue with an overloaded EnQueue method, which fires a delegate whenever any item is added to the queue. My problem is that, even if the smtpClient.Send call is executed successfully, all the mails are not sent until the running thread/process is killed. I can't understand the cause of the problem. Say I fired Send method 100 times. I am getting no exceptions, and all 100 calls are going through fine. But all 100 mails are not sent until I close the process from which Send method is fired. It will be very helpful, if I atleast get an explanation why this is happening, if not how to solve this. Thanks. Deb

    C# csharp help asp-net sysadmin testing

  • Cannot send all mails by SmtpClient.Send method until process is killed
    D debnarayan

    Hi, Thanks for the reply. "Try using the async version of the Read method." -- I hope you meant SendAsync method. I have already tried with the SendAsync method, and handled the callback. But it was of no help. So I have implemented another part of the application with asynchronous delegate invoke, to release the caller/client instantly, while the Send operation part is synchronous. I think either the Framework, or the OS is maintaining a buffer somewhere, which is getting flushed when the process terminates. However this is what I think, and I can't solve this problem right now. Thanks, Deb

    C# csharp help asp-net sysadmin testing

  • Cannot send all mails by SmtpClient.Send method until process is killed
    D debnarayan

    Hi all, I tried to write a mail queuer with C#. At the Mail Sending step, I am using smtpClient.Send(mailMessage) call. The call is not throwing exception. The application is made to wait by a Console.Read() call after sending all the mails in a loop. [I have tried with 10, 100, 2500 mails at different shots] But 100% of the mails I have sent do not reach my mailbox when the application waits at the Console.Read(). However, as soon as I hit enter, all the pending mails are sent. But I need this app to run on a webserver. While testing the same code as WebService, I had to restart the server [ASP.NET Development Server] to send those pending mails. Now I am at a fix, because my smtpClient.Send() methods are fired nicely without any exception, but probably the mails are queued at some other end, which I don't know how to flush. Please help. Thanks in advance. Deb

    C# csharp help asp-net sysadmin testing
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups