daab transaction

silverP

New member
Joined
Mar 28, 2006
Messages
3
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...:
Code:
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???
 
Last edited by a moderator:
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???
 
There is no GetConnection method on the Database class provided by the enterprise library - you cant 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.
 
Back
Top