ADO.NET Transaction without SqlClient?

L

localhost

Is it possible to do an ADO.NET transaction using just the OleDb space
and not touch the managed SqlClient at all?

I am trying to build a common data component that must work with
Oracle and MsSql and 3 other databases, all support XA-style
transactions. I hope that I can use just the OleDb provider to do
transactions so keep from doing many provider-specific things.

Is it possible?

Thanks.
 
M

Miha Markic [MVP C#]

Sure (but it is a database transaction, never an ado.net transaction).
See OleDbConnection.BeginTransaction Method.
 
K

Kevin Yu [MSFT]

Thanks for Miha's quick response!

Hi localhost,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to start transactions in the
OleDb provider. If there is any misunderstanding, please feel free to let
me know.

We can use OleDbTransaction class to achieve this. Just as Miha said, using
OleDbConnection.BeginTransaction method, we can get an OleDbTransaction
object to manipulate on. For more information about OleDbTrasaction class
and OleDbConnection.BeginTransaction method, please check the following
links:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdataoledboledbtransactionclasstopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemDataOleDbOleDbConnectionClassIDbConnectionBeginTransactionTopic.a
sp

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

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