score:3

Accepted answer

The short answer is: you can't.

You can do something like:

var q = from account in dataContext.Accounts
    where account.amount < 1000
    select account;

dataContext.DeleteAllOnSubmit(q);

But, because the framework needs to track concurrency issues it will always execute separate deletes (so if you have 500 rows that would be deleted, it will send 500 delete statements)

For a longer version and a solution see: http://www.aneyfamily.com/terryandann/post/2008/04/Batch-Updates-and-Deletes-with-LINQ-to-SQL.aspx


Related Articles