Hello,
How to do bulk update from datatable to SQL table in C#.
I have data in datatable and I have target table in SQL.
I want to do bulk update into SQL table considering some columns as condition.
Please help me with this.
Thanks,
Rahul.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ramesh MaruthiRank #937 · 2.2K reputationPosted Dec 11, 2014, 6:43 AM EST
its also mentioned for updating if it exists but here is the extra thing u need to do is, creating a temp table and writing a stored proc for updating. I think directly with sql bulk copy u can't do without creating a temp table. In entity framework we can do bulkupdates by using entity bulkupdate but I don't know without entity framework
please see the below mentioned links
http://stackoverflow.com/questions/20635796/bulk-update-in-c-sharp
http://forums.asp.net/t/1831869.aspx?SQLBulkCopy+Update+possible+
Ramesh MaruthiRank #937 · 2.2K reputationPosted Dec 11, 2014, 6:14 AM EST
Rahul Sharma10 reputationPosted Dec 11, 2014, 6:35 AM EST
This is for insert. I want to write code for update.
Thanks,
Rahul
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Dec 11, 2014, 6:15 PM EST
rakesh kumar16 reputationPosted Mar 27, 2020, 6:16 AM EDT