How do you verify that SubmitChanges() worked for inserts and updates? The method doesn't return a bool or int value.
views:
187answers:
1
+1
A:
If an insert fails it will throw a SqlException. I think it may do the same for failed updates.
jrummell
2009-09-25 16:51:18
I guess i'll just wrap the call with a try and catch
burnt1ce
2009-09-25 18:06:39
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
2009-09-25 18:49:02