sqlserver超时时间已到

复制代码


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; }
复制代码

 

posted @   Coder_小菜  阅读(1391)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示