7

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>
2
  • 2
    That is much more likely to mean that your connection string is wrong. Commented Jun 29, 2012 at 16:35
  • There's some help on this over here, too: stackoverflow.com/questions/10286685/… Commented Jun 29, 2012 at 16:56

1 Answer 1

22

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

Sign up to request clarification or add additional context in comments.

1 Comment

Don't forget to attach the event handler if you are creating the datasource on code behind: SqlDataSource1.Selecting += SqlDataSource1_Selecting;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.