[Mono-list] Re: [Mono-devel-list] Mono.Data.ProvidersFactory

Everaldo Canuto everaldo_canuto at yahoo.com.br
Fri Feb 25 11:29:19 EST 2005

Hi Aleksandar,

> Is is using native data providers like System.Data.SqlClient, Npgsql,
> etc. or you have implemented all of them?

Yes... Adp uses a native provider but it is "transparent" to you. If you
have another provider that are not implemented on Adp then you set your
new provider on "app.config". Additionaly Adp implements new methods
insome classes to easy development like a AdpCommand.ExecuteDataSet and
AdpCommand.ExecuteDataTable (I love this methods!).

> I'm currently working on a project that needs a runtime changing of
> data provider so a month or two ago, I set down and tried to write
> data layer independent of the underlying database. I run into a big
> problem: didn't know how to write adapters for classes like
> SqlTransaction and similar. Ex. SqlTransaction class is sealed and
> doesn't have proper constructors to call when you want to instantiate
> an object of that type. How did you wrote them?

Hey... my english is not good explain it, attached my AdpTransaction.cs
and AdpConnection, if you like to view all source code please download
from homepage.

Basically I have create a class that inherits IAdpTransaction and I use
two internal fields to access native transaction class. When you call
AdpConnection.BeginTransaction then I create a AdpConnection and set
internal field to native transaction... when you call as examples
AdpTransaction.Commit then AdpTransaction redirect this call to native
transaction commit.

If you have some questions I will be happy to help you :)


More information about the Mono-devel-list mailing list