If i use my web service in IIS-7 then in mysql it reuse the connection pool, but if I used it in IIS-6 then it is not reusing the pool
If i use my web service in IIS-7 then in mysql 开发者_如何学Cit reuse the connection pool, but if I used it in IIS-6 then it is not reusing the pool and after some time giving connection pool error. why it is giving error.
Can anyone help me
Are you closing the connection properly using either a using statement or a try/finally?
using (MySqlConnection conn = new MySqlConnection("string"))
{
conn.Open();
// your code here
}
or
MySqlConnection conn = null;
try
{
conn = new MySqlConnection("string");
conn.Open();
// your code here
}
finally
{
if (conn != null) { conn.Close(); }
}
精彩评论