Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

hi, I have to do a project using daab transaction using Microsoft visual studio(vb).

 

is there any website or book anyone can recommend whereby they give step by step or detailed way on how bout doing it???

 

I am having troubles wif my code, the bolded part has an error and i have no idea y...:

Imports Microsoft.VisualBasic
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports System.Data.SqlClient
Imports System.Data.Common
Imports System.Data
Imports System.Transactions

   Public Function ConfirmTransactions(ByVal tempCID As String)
       Dim db As Database  = DatabaseFactory.CreateDatabase()
       Dim connection As IDbConnection

       Using (connection = [b]db.GetConnection[/b]())
           connection.Open()
           IDbTransaction(Transaction = connection.BeginTransaction())

           Try

               db.ExecuteNonQuery(Transaction, "CreditAccount", srcAccount, amount)
               db.ExecuteNonQuery(Transaction, "DebitAccount", dstAccount, amount)

               Transaction.Commit()


           Catch e As Exception

               Transaction.Rollback()

           End Try

           connection.Close()

       End Using
   End Function

can anyone help me???

Edited by PlausiblyDamp
Posted

i get 'Getconnection' is not a member of 'microsoft.practices.enterpriselibray.data.database'

 

is this due the reason tt there is something i didn import in???

  • Administrators
Posted

There is no GetConnection method on the Database class provided by the enterprise library - you can't just go making up function names and expecting them to work.

 

I would strongly recomend having a look at the documentation that accompanies the enterprise library as this is all contained in there.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

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...