suki_ash Posted March 6, 2007 Posted March 6, 2007 Hi I am a new bie to transactions in .Net. I want to maintain transactions in my code. Please see the following pseudo code. public sub update() { cmd.Update() 'Update the database createFiles() 'Update the File server by creating some files cmd.Insert() 'Insert some records in the database ---------- some more code } Now, here i need to maintain the transaction scope in the method update(). Whereever it got a problem in this method, it should be rolled back. I tried the TransactionScope in .Net framework 2.0 but it seems like not working. Please suggest me some way to do this. Thanks in advance, Subhash. Quote
georgepatotk Posted March 29, 2007 Posted March 29, 2007 what database u are using? if i am using mysql, i would set AUTO COMMIT Quote George C.K. Low
amir100 Posted March 30, 2007 Posted March 30, 2007 How about using the BeginTransaction method from the Connection object. If your database support transaction then you can handle commit and rollback in your application. CMIIW. Quote Amir Syafrudin
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.