I am looking for a method to prematurely abort a SQL Query that may or may not be running for a long time. I work in a data warehouse environment and am developing software for which this is a requirement. Does anybody know the method to stop a query whilst it is running using C# or VB.NET ?
This is a desktop / windows forms application.
Thanks all!
Abort SQL Query using C#How to abort SQL Query programatically using C#
Page 1 of 1
2 Replies - 2508 Views - Last Post: 06 July 2010 - 09:11 PM
Replies To: Abort SQL Query using C#
#3
Re: Abort SQL Query using C#
Posted 06 July 2010 - 09:11 PM
If you are worried that a SQL statement may take a long time, use the async calls:
BeginExecuteNonQuery(), BeginExecuteReader(), etc.
Then if you determine that it has taken to long, you can use the End... calls to stop them.
BeginExecuteNonQuery(), BeginExecuteReader(), etc.
Then if you determine that it has taken to long, you can use the End... calls to stop them.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|