Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a gridview that was populated from a SQL Query. I now want to create a new table in another database using the data in the gridview. Do I have to extract each row from the gridview and update the new data base one row at a time? Can this be done all at once? Any suggestions would be appreciated.
Posted

1 solution

Yes, bulk update is supported in ASP.NET. One of the ways is to pass the data as xml. There is another method using SQLDataSource but that is not of much use in practical scenarios.
Below links which describes few methods -
Bulk Update using Gridview and Sql Server XML [^]
http://msdn.microsoft.com/en-us/library/aa992036.aspx[^]
There is an article on CodeProject which goes an extra mile by extending the GridView to add bulk update feature directly to it. And it's here - Bulk Edit with GridView without xxxDataSource (SqlDataSource, ObjectDataSource, etc.)[^]

Hope this helps!
 
Share this answer
 
Comments
Ankur\m/ 9-Jan-12 9:19am    
IIRC, I implemented this using disconnected architecture and SQLCommand update command do most of the job to do the bulk update. I do not have that code with me now. :(

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