hi to all
can any one explain detailed about exception handling in c# with some examples
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Dec 28, 2009, 1:14 AM
Try below articles available on Site it self
http://www.c-sharpcorner.com/UploadFile/rekhasingh1610/208192009021309AM/2.aspx
http://www.c-sharpcorner.com/UploadFile/skumaar_mca/ExceptionHandling09142009012625AM/ExceptionHandling.aspx
srinivasPosted Dec 28, 2009, 3:45 AM
Kirtan PatelPosted Dec 28, 2009, 3:39 AM
this type of exception is thrown by the application when non fatal error occur in application
srinivasPosted Dec 28, 2009, 3:34 AM
I saw some where that for user defined exception we have to derive System.ApplicationException class what it means
Kirtan PatelPosted Dec 28, 2009, 3:30 AM
and User defined Exception = Own own exception i shown you process in above post how to throw it :)
srinivasPosted Dec 28, 2009, 3:28 AM
catch(myex)
{
//some message
}
is this is correct or any other process is there
and can you explain about user defined exceptions
Kirtan PatelPosted Dec 28, 2009, 2:41 AM
suppos for example you want to throw exception when user enters name = "user" in textbox then you can do this
like below
string str = TextBox1.Text;
if(str == "user")
{
Exception myex = new Exception("My Own Exception");
throw myex;
}
that will generate your own exception :)
srinivasPosted Dec 28, 2009, 2:15 AM
thank you