sql数据源的超时错误

Clo*_*oud 7 c# sql asp.net datasource

错误代码:

超时已过期.操作完成之前经过的超时时间或服务器没有响应.

有人可以提供我可以复制和粘贴的代码,以便我可以更改默认超时吗?我不知道在哪里把它放到这段代码中:

<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>
Run Code Online (Sandbox Code Playgroud)

Fra*_*dal 21

您可以像这样增加Timeout属性

protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
        {
            e.Command.CommandTimeout = 0;
        }
Run Code Online (Sandbox Code Playgroud)

将timeout设置为0表示没有超时