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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
rakesh kumarPosted Mar 27, 2020, 10:16 AM
Manish Kumar ChoudharyPosted Dec 11, 2014, 11:15 PM
Ramesh MaruthiPosted Dec 11, 2014, 11:43 AM
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+
Rahul SharmaPosted Dec 11, 2014, 11:35 AM
This is for insert. I want to write code for update.
Thanks,
Rahul
Ramesh MaruthiPosted Dec 11, 2014, 11:14 AM