Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
我的链接都关闭了,可还是有这个问题,怎么回事啊?有时候也会报这个错误.ExecuteReader requires an open and available Connection. The connection's current state is connecting
在本地测试没问题,传到服务器上偶尔会出现这样的情况,这是服务器编译问题还是我的代码有问题,谁能给我个sqldatareader方法!
我的链接都关闭了,可还是有这个问题,怎么回事啊?有时候也会报这个错误.ExecuteReader requires an open and available Connection. The connection's current state is connecting
在本地测试没问题,传到服务器上偶尔会出现这样的情况,这是服务器编译问题还是我的代码有问题,谁能给我个sqldatareader方法!
public static newtype getAllnewtypeByid(int newtypeid)
{
newtype objnewtype = null;
string sql = "select * from newtype where newtypeid=@newtypeid";
SqlDataReader reader = DBHelp.GetReader(sql, new SqlParameter("@newtypeid", newtypeid));
try
{ if (reader.Read())
{
objnewtype = new newtype();
objnewtype.Newtypeid = (int)reader["newtypeid"];
objnewtype.Typename = (string)reader["typename"];
}
}
catch
{
return null;
}
finally
{
reader.Close();
reader.Dispose();
}
return objnewtype;
}帮忙看看对不?