>I have created a stored procedure which does a backup. From a VB.NET application, I can execute that stored procedure. However, this does not execute in background. So, the application freezes during that time. And, short after, I get a timeout expiration message. As this is a backup, is there a way to have this stored procedure to be started and my VB.NET application would continue immediately? Or, is my only way to execute that would then be from the Agent?
Can you just start it up on a new thread?
C# Version
public class MySample
{
public void DoSomething()
{
// Code runs Stored Proc
}
}
MySample sample = new MySample();
System.Threading.Thread thread = new System.Threading.Thread(sample.DoSomething);
thread.Start();
''VB Version
Public Class MySample
Public Sub DoSomething()
'' Code runs Stored Proc
End Sub
End Class
Dim sample As MySample = New MySample()
Dim thread As System.Threading.Thread = New System.Threading.Thread(sample.DoSomething)
thread.Start()
I use a variation of this for some of the things I do where I fire off an event async:
http://www.rcs-solutions.com/blog/2007/10/19/SpeedingUpMyASPNETApp.aspx