Bulk update/Insert data to sql data base
I have collection of object that contain several properties. I need to update this object list in the data base, now, i am looking for the best way to do it. Until now i use to work with xml, i created xml structure from the object list and send it to the data base and in the data base i parsed the xml and insert/update the tables i need.
Can you please suggest me better way to do that?
Sql 2005, M开发者_StackOverflow社区VC 2, C#4.
Thanks..
From what you've written, you'd probably be best to just loop through your collection and save each one using ADO.Net. That avoids the overhead of serializing your data to XML and then parsing it again on the database side.
That being said, unless this data is being generated by your software, you probably should be looking at something like SSIS or BCP for moving large amounts of data into SQL Server from whatever source your program is getting the data.
精彩评论