-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: rags_rao
Message 6 in Discussion
i thnk u shld use 1 connection object (or maybe have connection as static
member of use dataaccess class).
Use commit all the statements in the transaction have completed.
here's how i handled it................
conn.Open();
OleDbTransaction tran = conn.BeginTransaction();
try
{
int id = CBSView.InsertView(tran,userID,.....); //this is ur class 1
int chartid =
CBSChart.InsertChart(userID,...xmlSettings,moduleID,tran);//this is ur class
2
tran.Commit();
return chartid;
}
catch{tran.Rollback();return -1;}
finally{conn.Close();}
Regards,
Raghunandan R,
Software Engineer,
Nous Infosystems,
#1,1st main,1st block,kormangala,bangalore - 560034.
ph: +91-80-553 4208/552 2086
-----Original Message-----
From: dinesh_gr [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 03, 2004 6:31 PM
To: BDOTNET
Subject: Re: Handling Transactions in ADO.net
New Message on BDOTNET
Handling Transactions in ADO.net
Reply
Reply to Sender Recommend Message 4 in Discussion
From: dinesh_gr
HI Raghu...
Thanks for the Reply... I think i have not framed my question properly...
See there is a Common DB Acces class....
So the Class1 creates an separate Instance of the DBAccess class to do all
the DB operations..(including the Connection object).
Similarly..the Class 2 creates an separate Instance of the DBAccess class to
do all the DB operations.....(including the Connection object).
According to u...here i cannot handle transcation.. I should .redesign my
Class1 and Class2 such that it uses the same Connection object..is that what
, u are trying to say???
And one more thing... Should i use the COMMIT statement in Class1.. Because
if the are any errors in the opertaions done in Class2, then the data which
got inserted and commited beacuse of Class1, will be rolled back????
Pls do revert back...
Dinesh..
View other groups in this category.
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily
Horoscopes
To stop getting this e-mail, or change how often it arrives, go to your
E-mail Settings.
Need help? If you've forgotten your password, please go to Passport Member
Services.
For other questions or feedback, go to our Contact Us page.
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.
Remove my e-mail address from BDOTNET.
-----------------------------------------------------------
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]