![]() the code displays an indicator as it is working, verifying the the specified command against the connection. Given command text and connection string, asynchronously execute String commandText, string connectionString) Private static void RunCommandAsynchronously( RunCommandAsynchronously(commandText, GetConnectionString()) Ĭonsole.WriteLine("Press ENTER to continue.") "UPDATE Production.Product SET ReorderPoint = ReorderPoint - 1 " + "UPDATE Production.Product SET ReorderPoint = ReorderPoint + 1 " + The WAITFOR statement simply adds enough time to prove the This is a simple example that demonstrates the usage of the ![]() Normally, you would not take efforts to make your commands run slower, but doing this in this case makes it easier to demonstrate the asynchronous behavior. In order to emulate a long-running process, this example inserts a WAITFOR statement in the command text. The following console application creates updates data within the AdventureWorks sample database, doing its work asynchronously. For more information about streaming, see SqlClient Streaming Support. The Stream, XmlReader or TextReader object was closed during a streaming operation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |