网格视图编辑和更新问题 [英] grid view edit and update problem

查看:63
本文介绍了网格视图编辑和更新问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#,asp.net 2.0,Server 2005和Visual Studio 2005
任何人都可以解决以下错误:



我有一个带有编辑"和删除"按钮的gridview ...当我从下拉列表中选择一个项目时,它将使用数据库值加载gridview.

当我在网格视图中编辑该行并按更新"按钮时,它需要一些时间,后来却出现错误:

超时时间已到.操作完成之前已过超时时间,或者服务器没有响应.


请帮帮我.
在此先感谢.
问候,
Karan

I am using C#,asp.net 2.0,server 2005 and visual studio 2005
Can anybody help with the following error:



i have a gridview with edit and delete button... when i select an item from dropdownlist ,it will load gridview with database values.

when i edit the row in a grid view and press update button,,it takes some time and later it is giving error like :

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.


please help me.
Thanks in Advance.
Regards,
Karan

推荐答案

当数据库查询或存储过程无法在预设的超时时间到期之前完成执行时,将发生此错误.
做一件事

增加ASP.NET在引发异常之前等待数据库查询运行的时间.在应用程序中的代码自定义中,以编程方式在IDbCommand对象中设置CommandTimeout属性. IDbCommand是.NET Framework对象. CommandTimeout指定.NET等待数据库查询命令执行的时间(以秒为单位).将该值设置得足够高,以超过执行查询或数据库存储过程所需的时间.您可能需要逐个应用程序地调整此超时参数.

C#:

This error occurs when a database query or stored procedure is not able to complete execution before a pre-set timeout period expires.

Do one thing

Increase the amount of time that ASP.NET waits for the database query to run before throwing an exception. Programmatically set the CommandTimeout property in the IDbCommand object in a code customization in your application. IDbCommand is a .NET Framework object. CommandTimeout specifies the amount of time in seconds that .NET waits for the database query command to execute. Set that value high enough to exceed the amount of time required to execute your query or database stored procedure. You may need to adjust this timeout parameter on an application-by-application basis.

C#:

System.Data.IDbCommand.CommandTimeout = 50;



其次,

增加数据库驱动程序等待连接的时间.这与IDbCommand.CommandTimeout属性不同.必须正确设置两者,才能运行查询或存储过程.


有关更多信息,请访问 [



secondly,

Increase the amount of time that your database driver waits on your connection. This is different from the IDbCommand.CommandTimeout property. Both must be set properly for your query or stored procedure to run.


For more info visit[^]

Hope it helps ...... :)


在这里您

问题排查:超时已过期 [
Here you go

Troubleshooting: Timeout expired[^]


这篇关于网格视图编辑和更新问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆