超时分为多种,SqlConnection有超时选项,

SqlDataAdapter也有超时选项设置如下:

SqlConnection:就用链接字符串给予的Timeout设置就行单位秒;

SqlDataAdapter:sqlDataAdapter.SelectCommand.CommandTimeout = 120;//就是120s了

要用SqlDataAdapter,这个要单独设定TimeOut,连接字符串的TimeOut对它是不起效的

相关文章:

  • 2022-12-23
  • 2021-09-02
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-01-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2021-09-30
  • 2022-02-06
  • 2021-07-16
相关资源
相似解决方案