views:

187

answers:

1

How do you verify that SubmitChanges() worked for inserts and updates? The method doesn't return a bool or int value.

+1  A: 

If an insert fails it will throw a SqlException. I think it may do the same for failed updates.

jrummell
I guess i'll just wrap the call with a try and catch
burnt1ce
Throwing an exception on error is typically recommended over returning a boolean or affected row count. So I would recommend only catching the exception if you can do something about it (like log and rethrow).
jrummell