开发者

checking, operation successful after any LinqToSql operation

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜