-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Neeraj_Bangalore
Message 9 in Discussion
Hey
Correction in the previous mail , Correction is marked in Red Color.
-
--
-
-
-
-
Then if any statement in Try Block Returns an error then
it will be handled by its Catch block. So, if the code of instantiating and
using some code of class2 throws the error then it will be automatically handled
by the Try of the method of Class1. But since we are using Try Catch Block in
method of Class2 also, so If some statement of Try block of method of Class2
returns some error then it will be caught by its Try Block only, ie of the same
block, so you have to throw some exception again, which will be caught by its
parent Try Block, which is there in CLass1 and thus
that is it.
-
-
-
-
-
-
Regards,
Neeraj
Saluja
SCT Software Solutions, Bangalore
-----Original Message-----
From: Neeraj Saluja
Sent: Saturday, January 03, 2004 7:05 PM
To:
[EMAIL PROTECTED]
Subject: Re: Handling Transactions in
ADO.net
New Message on BDOTNET
Handling
Transactions in ADO.net
Reply
Reply to Sender Recommend
Message 8 in
Discussion
From: Neeraj_Bangalore
Hi Dinesh,
See the
behaviour of Exceptions are something like this :
If the code is
someting like this
Try
Catch
Endtry
Then if any
statement in Try Block Returns an error then it
will be handled by its Catch block. So, if the code of
instantiating and using some code of class2 throws the error
then it will be automatically handled by the Try of the method
of Class1. But since we are using Try Catch Block in method of
Class2 also, so If some statement of Try block of method of
Class2 returns some error then it will be caught by its Try
Block only, ie of the same block, so you have to throw some
exception again, which will be caught by its parent Try Block,
which is there in CLass2 and thus that is
it.
For Further
reference see the details of Throw and ThrowEx
Methods.
For sample, you
can use the statement in Catch Block of Class2 as
Throw New
System.Exception("An exception has
occurred.")
Try this Out
and tell me - How is it working for you ...
Regards,
Neeraj Saluja
SCT Software
Solutions, Bangalore
View other groups in this
category.
-----------------------------------------------------------
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]