SqlDataReader DataRead = frmMain.m_AccessDB.DownLoadFiles(RootInfo.iID, sYear.strName);
while (DataRead.Read())
{
.....
if (backgroundWorker1.CancellationPending == true)
{
DataRead.Close()
return false;
}
}由于DataRead中数据量较大,我Close()的时候总是超时,(测试的时候,connection都是正常的)请问如何解决,谢谢。
while (DataRead.Read())
{
.....
if (backgroundWorker1.CancellationPending == true)
{
DataRead.Close()
return false;
}
}由于DataRead中数据量较大,我Close()的时候总是超时,(测试的时候,connection都是正常的)请问如何解决,谢谢。
{
.....
}DataRead.Close()
一般都是把close()放到循环外,不知是否与这有关。。
{
....
}
这样不一样吗?
楼上正解,应该给分!!//
// 摘要:
// Gets or sets the wait time before terminating the attempt to execute a command
// and generating an error.
//
// 返回结果:
// The time in seconds to wait for the command to execute. The default is 30
// seconds.
[ResDescription("DbCommand_CommandTimeout")]
[ResCategory("DataCategory_Data")]
public override int CommandTimeout { get; set; }
默认是30秒 自己设一下吧