Aborting a running procedure
-
By setting a 10 second timer and then changing a flag or something. What are you aborting ? I assume a thread.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
semiramisContraA wrote:
How should I abort a running procedure if it takes longer than 10 seconds?
Since this is in the C# forum I'm guessing you actually mean method rather than procedure. If you do mean procedure (as in a stored procedure) then you should proceed to the SQL Server forum and ask there. You can run the method in another thread and WaitFor it to return. When you WaitFor it you can set a time out.
Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) - (part 3) My website | Blog
-
semiramisContraA wrote:
How should I abort a running procedure if it takes longer than 10 seconds?
Since this is in the C# forum I'm guessing you actually mean method rather than procedure. If you do mean procedure (as in a stored procedure) then you should proceed to the SQL Server forum and ask there. You can run the method in another thread and WaitFor it to return. When you WaitFor it you can set a time out.
Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) - (part 3) My website | Blog
-
I am trying to call a method of a web service & I want the request to be aborted if the web service takes longer than 10 seconds to answer!
-
If you are using a SoapHttpClientProtocol - derived class to invoke the web service you can set the Timeout property of it to 10 seconds.