[英]GridView has strange behavior with large amounts of data?
I am creating a web report that uses a GridView
with a SqlDataSource
as the data source, and it is crashing for what seems to be large GridView
s. 我正在创建一个Web报表,该报表使用带有
SqlDataSource
的GridView
作为数据源,并且由于看起来很大的GridView
而崩溃。 The web page allows the user to enter a date range, click a "Search" button, and then it does a SQL query based on the dates. 该网页允许用户输入日期范围,单击“搜索”按钮,然后根据日期进行SQL查询。 I know that the query works and that the dates are pulled correctly, but here is what's happening to cause the crash:
我知道查询有效且日期正确提取,但这是导致崩溃的原因:
Description : An unhandled exception occurred during the execution of the current web request.
描述 :在执行当前Web请求期间发生未处理的异常。 Please review the stack trace for more information about the error and where it originated in the code.
请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息。 Exception Details : System.InvalidOperationException: Operation is not valid due to the current state of the object.
异常详细信息 :System.InvalidOperationException:由于对象的当前状态,操作无效。
What is happening here? 这是怎么回事
I am executing this in debug mode on VS 2008, and I am coding in C# ASP.NET, if any of that makes a difference. 我在VS 2008上以调试模式执行此操作,并且在C#ASP.NET中进行编码(如果有区别的话)。 Also, I'm not sure what code would help, let me know if I need to edit and post some.
另外,我不确定会使用什么代码,请告诉我是否需要编辑和发布一些代码。
EDIT Here is the Stack Trace: 编辑这是堆栈跟踪:
[InvalidOperationException: Operation is not valid due to the current state of the object.] System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2692462 System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +61 System.Web.HttpRequest.FillInFormCollection() +148
[InvalidOperationException:由于对象的当前状态,操作无效。] System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded()+2692462 System.Web.HttpValueCollection.FillFromEncodedBytes(Byte []字节,编码编码)+61 System.Web。 HttpRequest.FillInFormCollection()+148
[HttpException (0x80004005): The URL-encoded form data is not valid.] System.Web.HttpRequest.FillInFormCollection() +206 System.Web.HttpRequest.get_Form() +68 System.Web.HttpRequest.get_HasForm() +8743895 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97 System.Web.UI.Page.DeterminePostBackMode() +63 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +133
[HttpException(0x80004005):URL编码的表单数据无效。] System.Web.HttpRequest.FillInFormCollection()+206 System.Web.HttpRequest.get_Form()+68 System.Web.HttpRequest.get_HasForm()+8743895 System.Web.UI.Page.GetCollectionBasedOnMethod(布尔dontReturnNull)+97 System.Web.UI.Page.DeterminePostBackMode()+63 System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)+133
There you go, you have exceeded postdata limit . 到此为止 , 您已经超出了postdata的限制 。 I believe you are posting back your entire grid to the server.
我相信您是将整个网格重新发布到服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.