asp.net 3.5 linq batch update?
Looking for a bit of advice on this. I 开发者_JAVA技巧have a fairly robust .net web app where up till now ive only had to deal with records (in a sql server database) one at a time. I now have a requirement to do a batch update, of probably around 100 - 200 records at a time. I prefer using LINQ for querying, I know its not the best but just through personal choice I suppose. What would be the best way to approach this?
thanks
DD
If you want to update a set of records using a single SQL statement, you won't be able to do that with LINQ. You can certainly do a group of updates together, but it will be one statement per update using standard LINQ. If you've already got a LINQ connection open, I'd suggest constructing a SQL command using that, enlisting it in the same transaction as any queries you've started with LINQ if necessary.
精彩评论