Timeout error for sql data source

Error code:

Timed out. The wait period expires before completion or the server is not responding.

Can someone provide me with a code that I can copy and paste to change the default timeout? I'm not sure where to put it in 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> 
+6
source share
1 answer

You can increase the Timeout property as follows

 protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e) { e.Command.CommandTimeout = 0; } 

Latency to 0 means no timeout

+17
source

Source: https://habr.com/ru/post/913973/


All Articles