Help implementing a transaction

L

LBS

Hello guys

I'm trying to implement a wrapper class, and I'm havinf difficulty
implementing the transaction.

I have several classes. The wrapper WrapDbCommand, WrapConnection..etc, and
the actual SQL server class.
The connection, parameter,executes works fine.

However, When I tries to create a transaction, my property always return
"nothing"

I must not use the correct syntax.
Could somebody point me out the syntax ?



Public MustInherit Class WrapDbCommand

Implements IDbCommand



Public MustOverride Function CreateParameter() As
System.Data.IDbDataParameter Implements
System.Data.IDbCommand.CreateParameter

Public MustOverride Function ExecuteNonQuery() As Integer Implements
System.Data.IDbCommand.ExecuteNonQuery





Public MustOverride Property Transaction() As System.Data.IDbTransaction
Implements System.Data.IDbCommand.Transaction
Etc...

=================

Public Class WrSqlCommand

Inherits WrapDbCommand


Public Overrides Property Transaction() As System.Data.IDbTransaction
Get
Return m_Command.Transaction
End Get

Set(ByVal Value As System.Data.IDbTransaction)
m_Command = CType(Value, SqlCommand)
End Set

End Property
Etc...

============

public class WrSqlConnection
Inherits WrapSqlConnection

Public Overloads Overrides Function BeginTransaction(ByVal iso As
System.Data.IsolationLevel) As System.Data.IDbTransaction

m_Connection.BeginTransaction(iso)

End Function
Etc..
 
L

LBS

Ken, I can't
I do not know what type of DB I will be using.
It could be SQL server, Oracle, DB2...etc
That's why I have a wrapper.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top