Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a error operation is not valid due to current state of object
i have the below solution
<appsettings>
<add key="aspnet:MaxHttpCollectionKeys" value="2001">

but this is valid for only 600 hundred records but i have 5000 records in grid.so what will be the right values for 5000 records
please help me
Posted
Comments
CRDave1988 20-Feb-12 6:49am    
NOt clear. where and when u get this error?

Dear Friend,

As i don't know what database statement you are using to read the data from the table, so assuming that you are using a data reader:-

Generally this occurs when your SQL statement returns no values, the reader has nothing to read. Which would also explain why it works sometimes, and it doesn't work other times.

Data reader requires an open connection since it works on connected architecture.check if the connection is opened. If the rows u r trying to read is locked by some other transaction, i guess oracle might throw this error, Check if u can give no lock hint with select statement.

I would suggest u to use disconnected architecture, usage of datasets. It is easy and simple. It reduces the load on database server. It gets the data and closes the connection automatically. In connected architecture i.e data reader the connection has to be remained open till all ur business logic is completed.
 
Share this answer
 
Comments
joti parkash 20-Feb-12 7:06am    
hello friends
i am allready using datatable for that
this solution is running for some system but some system have a problems
Varun Sareen 20-Feb-12 7:22am    
Please post some code then.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900