初步猜测和连接池有关的问题
源码:
string strConn="server=localhost;user id=***;password=***;database=test;Min Pool Size=10;Max Pool Size=5000";
SqlConnection mConnection1=new SqlConnection(strConn);
mConnection1.Open();
try
{
SqlDataAdapter MyAdapter1 = new SqlDataAdapter();
MyAdapter1.InsertCommand = new SqlCommand("Insert_Report2", mConnection1);
MyAdapter1.InsertCommand.CommandType = CommandType.StoredProcedure;
MyAdapter1.InsertCommand.Parameters.Clear();
MyAdapter1.InsertCommand.Parameters.Add("@spPrice1", SqlDbType.NVarChar , 10, "SPrice1");
MyAdapter1.InsertCommand.Parameters.Add("@spPrice2", SqlDbType.NVarChar , 10, "SPrice2");
MyAdapter1.Update (ds_type,ds_type.Tables[0].TableName);
}
catch(SqlException err)
{
string test2=err.Message .ToString ();
}
mConnection1.Close ();
mConnection1.Dispose ();
要不就是抛出"从池中获取连接 超时",要不就是运行到一定时间就僵在那里不动了,该关闭的也关闭了,maxpool也设置了,到底是怎么回事呢
问题点数:25、回复次数:1Top
1 楼sutalon(神州无敌)回复于 2005-03-02 21:31:13 得分 25
帮你顶Top




