超时已过期。操作完成之前经过的超时时间或服务器没有响应。在远程窗口上工作.net [英] Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. working on remote windows .net

查看:80
本文介绍了超时已过期。操作完成之前经过的超时时间或服务器没有响应。在远程窗口上工作.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#windows应用程序,需要连接MS SQL服务器并使用SP。但我得到超时已过期。在操作完成之前超时时间已过,或者服务器没有响应。错误。在远程系统的应用程序上出现此错误。

我已经指定了command.CommandTimeout = 0;和定时器设置为5000;我需要在预定的时间运行查询/ SP。命令是SqlCommand对象。但是也一样。



请帮助任何人!

提前致谢。

I am working with C# windows application, need to connect MS SQL server and use SPs. But I'm getting "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding." error. This error getting on remote system's application.
I already specified "command.CommandTimeout = 0;" and Timer is set to 5000; I need to run query / SPs for scheduled time. command is SqlCommand Object. But getting the same.

Please help any one!
Thanks in advance.

推荐答案

你好



你刚刚把



command.CommandTimeout = 0;



这里的命令是sql命令的对象





谢谢

Abhimanyu
hello

You just put

command.CommandTimeout = 0;

here command is object of sql command


Thanks
Abhimanyu


try
           {
               objErr = new ErrorLog(FilePath);
               objErr.SaveException("Call to Queued Result Start...");

               byte[] Thb_Templ = new byte[0];
               int PK_ID = 0;
               string Result = string.Empty;
               dsTemp.Clear();

               sqlcon.Open();
               if (sqlcon.State == ConnectionState.Open)
               {
                   sqlcon.Close();
               }
               else if (sqlcon.State == ConnectionState.Closed)
               {
                   sqlcon.Open();
               }
               string qry = "CIS_USP_DedupeStoreSGTemplate";
               sqlcmd = new SqlCommand(qry, sqlcon);
               sqlcmd.CommandType = CommandType.StoredProcedure;
               sqlcmd.Parameters.AddWithValue("@PK_ID", Convert.ToInt32(PK_ID));
               sqlcmd.Parameters.AddWithValue("@Thb_Templ", Thb_Templ);
               sqlcmd.Parameters.AddWithValue("@Result", Result);
               sqlcmd.Parameters.AddWithValue("@Action", "VIEW");

               adap = new SqlDataAdapter(sqlcmd);
               adap.Fill(dsTemp, "SGTemplates");
               sqlcon.Close();
               //ConvertTmplFromSGToISO(dsTemp);
               if (dsTemp.Tables.Count > 0)
               {
                   objErr.SaveException("Convert Queued Result To processing Start...");
                   ConvertDedupeStoreTmplFromSGToISO(dsTemp);
                   objErr.SaveException("Convert Queued Result To processing Ends...");
               }
               objErr.SaveException("Call to Queued Result Ends: ");
           }
           catch (Exception GenExp)
           {
               string FilePath = ConfigurationManager.AppSettings["XmlFilePath"].ToString();
               ErrorLog objErr = new ErrorLog(FilePath);
               objErr.SaveException(GenExp.Message);
           }


这篇关于超时已过期。操作完成之前经过的超时时间或服务器没有响应。在远程窗口上工作.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆