gpt4 book ai didi

c# - 延长查询超时时间

转载 作者:太空宇宙 更新时间:2023-11-03 23:39:44 24 4
gpt4 key购买 nike

我有以下代码,“有时”会出现超时错误

string select = @"query goes here";
connection1 = new SqlConnection("connection string goes ehre");
SqlDataAdapter dataAdapter = new SqlDataAdapter(select, connection1);
SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];

错误信息是:

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

如何延长超时时间?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com