An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Do not share connections among multiple threads.
Create a SqlConnection object for each of your queries, and wrap it with a using statement to close it in time after the execution ends.
.NET, the SqlConnection object, and multi-threading
Using the same open SQL connection from different threads
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.