Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,
Anyone tell me the efficient way to load the csv file which having more than 1 crore records. ie., the size of the file is more than 285MB. I've tried with oledb method, but i got Out of memory exception. Please help me to do this.

Regards,
Sathish
Posted

1 solution

If I were you I would use a StreamReader, and read the file one line at a time, saving the data to a database as I went.

Hope this helps
 
Share this answer
 
v2
Comments
bluesathish 23-Nov-11 4:04am    
No actuall i want to filter the input into two types, like datatable.select(column='value') this. Then the resultant datatables inserted to the database using sqlbulkcopy(). So i need to convert the input to the datatable. Please help me to do this.
I've tried StreamReader concept also the system getting hanging and went to not responding state. Please anyone help me to do this.

Regards,
Sathish
bluesathish 24-Nov-11 7:00am    
Dear All,
I need to know the maximum size of the csv file in which Oledbconnection can process in VB.NET Application, I can tested with the csv file which has more than 12,00,000 records, its fine. but if i give the csv file which has 1crore records then i got the out of memory exception. Please anyone help me to do this.

Regards,
BlueSathish

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