Click here to Skip to main content
15,902,939 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can we bind 5 lakh records from dataset to gridview...?its throwing error out memory in asp.net
Posted
Comments
Thanks7872 11-Jul-13 2:50am    
First of all,it makes no sense to bind 5,00,000 records to gridview at one time.Refine your logic such a way that gets data that needs attention. See,no one can/would like to or be able to go through this much data.So thats of no use.
bbirajdar 11-Jul-13 9:20am    
Who is going to read 5 lakh records ?

Hello sunil,
This is not a good programming to bind 5lac record to grid view and Why you bind 5lac record at same time make your code and query dynamic. I mean pass page size and how much record you want from data base and create select query depend on this.This why it will take less time to bind and not create any problem.
 
Share this answer
 
Comments
Sunil_Patil 11-Jul-13 5:27am    
bcz i'm going to expoting grid data into excel i cant give paging here at 1 short,data should come in excel
NAGARAJ N MACHAKNUR 11-Jul-13 6:20am    
try this,

Bind first 15 or 20 records to grid view provide filtering options. Based on user filtering selection fetch data from SQL then bind data to gridview. User cannot see 5 Lakh records at a time. If you provide filtering option it will be easy for user to see the required data and even it will solve your problem.
Please use paging for the Grid. and on the export to excel button click you can write the logic to get all the data and can dump to Excel.
 
Share this answer
 
Comments
Sunil_Patil 11-Jul-13 7:37am    
Yes we can change page property in code behind but it will not work while exporting bcz it kills all process so its exporting only how much we mentioned page size

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