Click here to Skip to main content
15,908,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using windows mobile application where i want to save or write large data from datagrid into csv in less time,
and i am using streamwriter to save or write data into csv

arround 30000 data should be save to csv.

any kind of help will be appreciated.
Posted
Updated 1-Sep-13 20:10pm
v2
Comments
Mehdi Gholam 2-Sep-13 2:24am    
...and your problem is?
ujali 2-Sep-13 5:17am    
more than 2000 data taking too much time
Richard MacCutchan 2-Sep-13 3:19am    
Less time than what?
ujali 2-Sep-13 5:16am    
less than 2 min

1 solution

 
Share this answer
 
Comments
ujali 2-Sep-13 5:19am    
i am not using sql ..the data is only in csv file,and i am writing string value in csv
ujali 3-Sep-13 12:42pm    
I used String Builder And Then i write that String To the File By using StreamWriter ,And IT Work..Now 16000 data is getting save into the file but i want 30000 data to be saved ,
If I put more data than 16000 then its giving error that out of memory Exception..
any kind of help will be appreciated.

and Thanks For the Solution given before..IT Was quite helpful
ridoy 3-Sep-13 13:07pm    
You can use batch processing logic to fetch records in batches say 5000 records per execution and store the result in a temp dataset and once all processing is done. Dump the data from temp dataset to excel.
You can use C# BulkCopy class for this purpose.
ujali 4-Sep-13 1:32am    
I am Not using sql, i am simply using streamreder to read csv file and then browsing into the DataGrid Of Windows Mobile Application,now when i am updating and saving or writing into csv Its Taking Only 16000 Lines Of data,So how can i use Bulkcopy if i am not using sql
ridoy 4-Sep-13 1:55am    
i think you can use thread to handle it,use some different threads and extract data in each thread suppose like i say per 10000.Then stop a thread and start a new one,that would not result a memory error bcz when a new thread starts the previous thread is out of the memory.

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