public DataTable GetProDataTable(string produceName, SqlParameter[] para)
{
DataTable dt = new DataTable();
SqlCommand command = new SqlCommand(produceName, this.sqlconn);
if (this.sqlTran != null)
{
command.Transaction = this.sqlTran;
}
if (this.CommandTimeout != -1)
{
command.CommandTimeout = this.CommandTimeout;
}
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddRange(para);
try
{
/* 这部分代码会占满连接池,产生异常
if (this.sqlconn.State == ConnectionState.Closed)
{
this.sqlconn.Open();
}
*/
SqlDataAdapter adapter = new SqlDataAdapter(command);
adapter.Fill(dt);
}
catch (SqlException ex)
{
//OriginalLog.Error(ex.ToString());
throw (ex);
}
return dt;
}