基于sql的前提
正常查询:
DataTable dt = DBHelper.DBXiaoMai.ExecuteDataSet(System.Data.CommandType.Text, sql).Tables[0];
设置超时:
System.Data.Common.DbConnection conn = DBHelper.DBXiaoMai.CreateConnection();
System.Data.Common.DbCommand exec = conn.CreateCommand();
exec.CommandText = sql;
exec.CommandTimeout = 120;
DataTable dt = DBHelper.DBXiaoMai.ExecuteDataSet(exec).Tables[0];