开发者

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(); }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜