相关疑难解决方法(0)

asp.net c#SqlDataSource timout问题

我正在尝试将SqlDataSource的超时延长超过30秒(似乎是默认值).我正在尝试运行一个必须运行100,000个记录的存储过程.在繁忙时段,它会超时.我在2003服务器上使用ASP.NET 4.0和IIS 6.0.

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

我试图无法延长超时:

< asp:SqlDataSource ID="dsTest" EnableCaching="true" CacheDuration="604800" runat="server" ConnectionString="<%$ ConnectionStrings:SuperNARIC %>" SelectCommand="selectStatus" SelectCommandType="StoredProcedure" onselecting="dsTest_Selecting" >
    <SelectParameters>
        < asp:ControlParameter ControlID="ddlCar" Name="CountryID" PropertyName="SelectedValue" Type="Int32" />
    < /SelectParameters>
< /asp:SqlDataSource>



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

任何帮助将不胜感激.

谢谢

c# asp.net

9
推荐指数
3
解决办法
2万
查看次数

标签 统计

asp.net ×1

c# ×1