Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • 4 weeks later...
Posted

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.

Amir Syafrudin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...