查询超时如何设置?
我用下面的方法查询数据,当查询时间超过40秒时就出现异常,请问有什么办法解决
//数据库查询方法,参数strSQL为SQL语句,dbconnectionstring为连接数据库字符串,返回DataSet数据集
public DataSet SelDB(string strSQL,string dbconnectionstring)
{
OleDbConnection sqlConn=new OleDbConnection(dbconnectionstring);
OleDbDataAdapter sqlDtApt;
DataSet ds=new DataSet();
try
{
sqlConn.Open();
sqlDtApt = new OleDbDataAdapter(strSQL,sqlConn);
sqlDtApt.Fill(ds);
sqlConn.Close();
}
catch(OleDbException e)
{
MessageBox.Show(e.Message.ToString());
}
return ds ;
}