- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试将 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;
}
如有任何帮助,我们将不胜感激。
谢谢
最佳答案
如前所述here ,这对我有用。
你可以像这样增加超时属性
protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
e.Command.CommandTimeout = 0;
}
设置timeout为0表示不超时
关于c# - asp.net c# SqlDataSource超时问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10286685/
我有一个 SqlDataSource,我正在尝试向其添加 UpdateCommand,以便在选择 GridView 的更新按钮时调用存储过程。我在后面的代码中执行此操作,因为我需要调用两个过程之一,具
我正在使用 SqlDataSource 来填充 GridView。这是我的代码: private void DataCall() { //Object gets created for use
作为我在所有业务应用程序中使用的常用实用程序的一部分,我有这段代码... using System.Web.UI.WebControls; public class Database {
我在我的应用程序中使用 SqlDataSource 来填充下拉列表,我在 Visual Studio 的网页设计中配置它。 我希望这个下拉列表会根据 sql 中的几个表动态变化。 可以从代码中以编程方
使用 .NET 4 和 C#。所有这些都会引发错误: sdsTypeinfo.SelectParameters.Add("@TypeCode", DbType.Boolean, DBNull.Valu
我偶然发现了一个问题,无法自己解决。希望有人能帮我解决。 所以,我在 SQL Server 2005 数据库中有一个简单的存储过程 CREATE PROCEDURE spTest @pin var
我一直有这样的想法,与使用 SqlDataSource 编写 SQL 查询相比,在后面的代码中编写 SQL 查询并不好 SqlDataAdapter ad = new SqlDataAdapter("
如果网页需要一些数据,为什么不让 SQLDataSource 调用存储过程呢?为什么要使用 ObjectDataSource 调用业务对象,然后再调用存储过程?我知道基于 .net 框架构建的其他应用
是否有一种合理的方法可以从 SqlDataSource 获取预期参数列表(给定分配给其 SelectCommand 属性的存储过程的名称)? 最佳答案 您可以使用 SqlCommandBuilder.
我有以下 SqlDataSource " InsertCommand="INSERT INTO [Chat] ([Username], [Message]) VALUES (@User
我有一个 SqlDataSource 正在向我的 GridView 提供数据。这就是我在表单上使用的所有内容,因此我根本没有任何代码。但在某个地方我需要一个 TRY CATCH block ,以防万一
我是 ASP.net 的新手,目前正在阅读有关 SqlDataSource 的内容并正在运行一些示例。我正在与一位同事交谈,他说它“适用于快速和肮脏的应用程序”,但没有人会在生产/部署环境中使用它。
假设我在 .aspx 页面上有某种数据网格或转发器,并且我的数据源是内联定义的,如下所示: 如何调试我的代码,以便我可以准确地看到 Year 绑定(bin
所以我有一个 GridView 设置为 SqlDataSource。分页已启用,我有一个下拉菜单,可以更改每页显示的行数。我可以获得单个页面中显示的总行数,但我也想显示总行数。 (像这样:“显示 31
我正在创建一个 ASP.NET/C# 页面,用户在页面顶部输入一个 ID,当他们按下提交时,页面回发并显示数据。现在,数据字段始终显示 - 即使在页面加载且未进行搜索时也是如此。这并不理想,因为当他们
我有一个 FormView,下面有一个 UpdateButton 和一个 SqlDataSource。我的 updatebutton 总是用相同的值(我的 gridview 第一行的值)更新 Sil
我有一个绑定(bind)到 SqlDataSource 的 GridView。我在执行 UpdateCommand 时遇到问题,它似乎执行了两次。当我单步执行 gvChecklist_RowUpdat
我有一个带有 OnInserted 处理程序的 SqlDataSource。处理程序发送一封电子邮件,其中包含从 Inserted 记录中收集的数据。包括它的 ID(输出参数)。 昨天,我收到处理程序
我有一个 Microsoft SQL 数据库和一个 MySQL 数据库,我需要将它们加入并放入 GridView 中。 到目前为止,我已经成功地使用了 ASP 和 SqlDataSource,如下所示
我正在尝试按文本框名称 PostCode1 从 SQLDataSource POSTCODE_Data 中过滤数据。 我通过使用 .Rowfilter 属性来执行此操作,但它不起作用。结果 POSTC
我是一名优秀的程序员,十分优秀!