How to catch SqlException in LINQ to SQL?

If the the the try-catch block you provided is inside the CreateNewCategory (looking at the stacktrace) method and the type of the exception being thrown is actually SqlException, then it should be caught.

If the the the try-catch block you provided is inside the CreateNewCategory (looking at the stacktrace) method and the type of the exception being thrown is actually SqlException, then it should be caught. Alternatively, if you want to catch all exceptions in the applications, you need to subscribe to the Application. DispatcherUnhandledException event for exceptions in the UI thread and AppDomain.CurrentDomain.

UnhandledException for exceptions in other threads.

It should be noted that Application. DispatcherUnhandledException and AppDomain.CurrentDomain. UnhandledException should only be used to log errors and let the app crash gracefully.

Don't try to recover from an exception using these events. – Phil May 4 at 16:40.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions