The timeout period elapsed prior to obtaining a connection from the pool

前端 未结 4 1134
醉梦人生
醉梦人生 2021-01-22 15:31

I\'m getting this error every few days. I won\'t see the error for a few days then I\'ll get a flurry of 20 or so all with in a minute or so.

I\'ve been very thorough go

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-22 16:09

    changing the code to something like this makes it easier to read..

    try
    {
      myConnection.Open();
      mySqlDataAdapter.Fill(myDataTable);
     }
    Catch (Exception err)
    {
      throw err;
    }
    finally
    {
     myConnection.Close();
    }
    

    But it doesn't help your timeout..

    It sound like the fill statement takes to long. Or that the problem actually is somewhere else, where you don't the connection. SQL Profiling could help figuring out if the select statement takes to long..

提交回复
热议问题