silverP Posted March 28, 2006 Posted March 28, 2006 (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 March 28, 2006 by PlausiblyDamp Quote
Administrators PlausiblyDamp Posted March 28, 2006 Administrators Posted March 28, 2006 What error are you getting? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
silverP Posted March 29, 2006 Author Posted March 29, 2006 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??? Quote
silverP Posted March 29, 2006 Author Posted March 29, 2006 by the way, i m using enterprise library too. Quote
Administrators PlausiblyDamp Posted March 29, 2006 Administrators Posted March 29, 2006 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
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.