Help with custom exception class [Resolved]

Posted by Bugwee under VB.NET on 6/17/2011 | Points: 10 | Views : 2588 | Status : [Member] | Replies : 2
Hi guys,

i will have to create a custom exception class in my project. I have a single method that inserts data into the database with any sql provider (mssql,mysql,etc.) specified. If an error happens/occurs, how to determine if the type of exception is either mysqlexception or sqlexception?

Regards,
Bugwee




Responses

Posted by: SheoNarayan on: 6/18/2011 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
Hello Bugwee,

Read this thread http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/34fa7127-c89e-4710-bdd3-2a7339dc6a3f answer. Actually you need to retrieve the type name from the exception object.

OR

You can also try by putting multiple catch statement with different exceptions.

Hope this helps.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Bugwee, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bugwee on: 6/21/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Sir Sheo,

Thanks a lot for the link.

Regards,
Bugwee

Bugwee, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response