问题描述
嗨先生,
i我在使用visual studio2010的Windows C#应用程序工作。
连接时使用我的主服务器,在Timeout过期时获得异常。操作完成之前已经过了超时时间,或者服务器没有响应。
在使用dataadaptor填充数据集时发生这种情况。
app.config中的连接字符串
add name =constringconnectionString =server = XXX.XXX.XX.XX; uid = XXXXXX; pwd = XXXXXXX;初始目录= XXXXXXX;连接超时= 0; providerName =System.Data.SqlClient
请给出解决方案
Nandakumar S.
Hi Sir,
i am working in windows C# application with visual studio2010.
When connect with my main server,getting exception as Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
this happening while fill with dataset with dataadaptor.
connection string as in app.config
add name="constring" connectionString="server=XXX.XXX.XX.XX;uid=XXXXXX;pwd=XXXXXXX ;initial catalog=XXXXXXX;Connect Timeout=0;" providerName="System.Data.SqlClient"
please give the solution
Nandakumar S.
推荐答案
Please also set Command object timeout to Zero and try
i.e
cmd.CommandTimeout = 0;
这篇关于超时已过期。操作完成之前经过的超时时间或服务器没有响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!