超时错误的SQL数据源 [英] Timeout Error for sql data source
本文介绍了超时错误的SQL数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
错误代码:
超时过期。之前的
操作完成的超时时间已过或服务器没有响应。
块引用>
可有人为我提供的代码我可以复制和粘贴,所以我可以更改默认的超时?我不知道在哪里把它变成这个代码:
<头=服务器>
<标题>代理报告< /标题>
< /头>
<身体GT;
<表ID =form1的=服务器>
< DIV>
< ASP:标签ID =Label1的=服务器文本=代理报告>< / ASP:标签>
< / DIV>
< ASP:GridView控件ID =GridView1=服务器的DataSourceID =SqlDataSource1>
< / ASP:GridView的>
< ASP:SqlDataSource的ID =SqlDataSource1=服务器
的ConnectionString =<%$的ConnectionStrings:ISALog1ConnectionString%>中
的SelectCommand =ProxyReportSelectCommandType =StoredProcedure的>
< / ASP:SqlDataSource的>
< /表及GT;
< /身体GT;
< / HTML>
解决方案您可以增加超时属性类似这样
保护无效SqlDataSource1_Selecting(对象发件人,SqlDataSourceSelectingEventArgs E)
{
e.Command.CommandTimeout = 0;
}
设置超时时间为0表示没有超时
Error code:
Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Can someone provide me with code I can copy and paste so I can change the default timeout? I'm not sure where to put it into this code:
<head runat="server"> <title>Proxy Report</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Proxy Report"></asp:Label> </div> <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ISALog1ConnectionString %>" SelectCommand="ProxyReport" SelectCommandType="StoredProcedure"> </asp:SqlDataSource> </form> </body> </html>
解决方案You can increase the Timeout property like this
protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e) { e.Command.CommandTimeout = 0; }
Setting timeout to 0 means no timeout
这篇关于超时错误的SQL数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文