-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: saileshsaha
Message 10 in Discussion
You can use the following code to catch exceptions: void YourMethod( ) { try
{ // your implementation code to access the database }
catch(SQLException sqle) { // if you want to have the
exception caught and processed here itself, then define the implementation code here
itself. // else if you want to throw/bubble the exception up the call
statck to be processed by the parent method, // then you use
throw(sqle); // this statement will bubble up the caught exception
to the parent method which called this method. This exception will be
//caught in the parent method and you can have your logic implemented there to log or
process this exception there. If you //still want to bubble it up
further on the call stack, you can again use the throw statement there. }
finally { // always make it a practice to use the finally
block aftet the try catch block so that any statement which is necessary to be
// executed whether or not an exception is raised, can be implemented in this
block. You can have // resource freeing code here etc. The statemented
written in thsi block will definitely execute. } Hope this helps you.
Regards, Sailesh
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]