开发者

checking, operation successful after any LinqToSql operation

开发者 https://www.devze.com 2022-12-17 07:59 出处:网络
We normally use these statements to add anew record to database. MyDataContext.InsertOnSubmit(AnObject);

We normally use these statements to add anew record to database.

MyDataContext.InsertOnSubmit(AnObject);
MyDataContext.SubmitChanges();

Other than using stored proced开发者_如何学JAVAure(can return a value by "Return / Output"), is there a way to return a value indicating, operation was successful ? probably, Linq own methods / functions

Any idea, Thanks


If the operation is not successful, then it will throw an exception. If it doesn't throw an exception, then it was successful.


Couldn't use a try and catch block and trap the appropriate errors?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号