How to Update/delete some rows?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Blave
Posts: 9
Joined: Fri 23 Sep 2011 12:46

How to Update/delete some rows?

Post by Blave » Fri 23 Sep 2011 12:56

I can update one row by:
db.table.First().Salary = 99999;

But, how can I update some rows without foreach, for, or while loop?

Thanks for your help.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 26 Sep 2011 11:23

LINQ to Entities is used only the SELECT queries (no DML support). So it is necessary to read all records on the client's side (foreach, for, or while loop), modify, and write to database. Usually this task can be done faster using native SQL (not EF).
If you have to use Entity Framework, please try Batch Updates (http://www.devart.com/blogs/dotconnect/ ... html#Batch).

Post Reply