Click here to Skip to main content
15,888,007 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a datagrid which is created by various action and user's manipulation of data. I want to insert all the data of the grid to the database at once
Posted
Comments
Afzaal Ahmad Zeeshan 7-Mar-15 9:49am    
Execute the command for INSERT INTO, for each of the item in DataGrid, or save the DataGrid object as binary code in the binary format.

1 solution

You need to convert the data to xml and you can use OPENXML to insert all the data to the table at once. Here is an nice article about that


[^]

But becareful about how much data you are loading at once because if you are working on WPF application it's a windows application when all the data is loaded at once your system may throw out of memory exception. This defers from system to system as each system will have different configurations. so it's better to load data in chunks for Windows applications.
 
Share this answer
 
v5

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