Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating multiple rows with EF
Message
De
30/04/2015 11:04:14
 
 
À
29/04/2015 18:13:45
Information générale
Forum:
ASP.NET
Catégorie:
Entity Framework
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01619231
Message ID:
01619285
Vues:
53
>>>>Hi everybody,
>>>>
>>>>I did a quick research in Google and found that if we want to update multiple rows, we would need to loop through each row and update separately. I just want to make sure it's true and this is what I need.
>>>
>>>If I understand correctly, if there are 100 items in your collection, this will fire 100 UPDATE statements back to the database. Am I correct?
...
>I'm know you know this - it's very sad if indeed EF doesn't support table types. TTs were implemented in SQL 2008. I think nearly seven years is enough time. :)
>Actually, if you were using pure ADO.NET, you can pass a datatable to a proc and do the UPDATE in one DML statement.
>If EF can't do this, I think it's pretty unfortunate.

I had read in Screppas book that there are different method signatures for update, dataset and datatable amongst them.
But as he always was big on only updating only changed rows I guessed even the methods working on more than rows would work via chatty implementation sending N update statements. Have you checked the logs/wire if a table is sent in 1 msg in such a datatable update, and if so, is it a pruned table including only changes?

curious

thomas
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform