Click here to Skip to main content
15,896,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one data set and i wanted to insert data from one of the table in dataset and some data want to update i used SqlBulkCopy for that for insert but want to update bulk of data hwo can i do this?
Posted
Comments
[no name] 13-Jan-15 8:13am    
Please look at:
http://www.codeproject.com/Articles/417181/Bulk-Insertion-of-Data-Using-Csharp-DataTable-and
http://www.codedigest.com/Articles/Framework/388_Doing_Bulk_UploadInsert_of_DataTable_to_a_Table_in_SQL_server_in_C_.aspx
http://stackoverflow.com/questions/20635796/bulk-update-in-c-sharp
Tomas Takac 13-Jan-15 8:50am    
There is no bulk update. If you don't want to update the data table row by row (via data adapter), you need to build the infrastructure yourself. For example bulk insert the data into a temporary table then run a command or stored procedure to do the update.

Can you explain in more detail,
if you want to update some data and insert some data in same table basis some validation go for merge statement.

You can send the datatable to your database using .net.
Depends how much data you are passing.

Regards,
Santosh
 
Share this answer
 
My advise would be like


1. Build an XML string of the data you like to update.

2. Send the XML string to a new Stored Procedure which will parse the XML string

3. Use SQL Merge statement to update all the values in one go!

You can do google to get more precise details!
 
Share this answer
 

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