views:

33

answers:

2

I have a simple LINQ to SQL delete statement and would like to know if there is a way to find out the number of records deleted?

Sample code would be appreciated

A: 

See some of the examples in this thread, should be enough to work it out...

http://forums.asp.net/t/1213295.aspx

Tim Hoolihan
+5  A: 

This should help you out: GetChangeSet

jaltiere
That helps but doesn't solve my problem. If I try to delete a record that doesn't exist, the LINQ statement throws an exception and the GetChangeSet call never happens. Am I missing something?
mcass20
@mcass20 - Just because LINQ throws an exception in this case, doesn't mean the entire Submit gets rolled back. It will depend on what you do with the exception.
Randy Minder