VisualStudioFeeds

All Visual Studio blogs in one place

AddThis Social Bookmark Button
One of the most common errors observed when connecting to SQL Azure is – A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An established connection was aborted by the software in your host machine.).  This issue happens when SqlClient grabs an invalid connection from the pool (connections in the pool become invalid due to throttling in the network or in SQL Azure itself) and returns it to the application.  As a consequence, when it tries to effectively use the connection (like executing a command, for example); a
SqlException exception is raised. Let’s consider the code snippet below: try {     // Let’s assume the connection string uses default connection pool set to true     // and the connection pool was already previously created for this same     // connection string     using (SqlConnection connection = new SqlConnection("…"))     {         // If the connection pool in not empty,         // even if the connection returned above is dead,         // the SqlConnection.Open command below executes succesfully.         connection.Open();           SqlCommand command = new SqlCommand("select product_name from products");        ...(Read whole news on source site)

Search

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Home : Blog List : ADO.NET team blog - Site Home - MSDN Blogs : Minimizing Connection Pool errors in SQL Azure