OK, this is going to sound like I'm spamming the ng, but that is not my intention. I'm only answering the question.
I have an architecture built on the Enterprise Library called
EasyObjects.NET.
In the base class I have a LoadFromSql() function (used to call custom
stored procedures) that automatically participates in the current
transaction, so it is possible to do what you are asking. Here's a
partial listing from that function:
TransactionManager txMgr = TransactionManager.ThreadTransactionMgr();
try
{
// Create the Database object, using the
default database service. The
// default database service is determined
through configuration.
Database db = GetDatabase();
...<snipped>
IDbTransaction tx = txMgr.GetTransaction(db);
DataSet ds;
if ((tx == null))
{
ds =
db.ExecuteDataSet(dbCommandWrapper);
}
else
{
ds =
db.ExecuteDataSet(dbCommandWrapper, tx);
}
Load(ds);
}
See the EasyObjects.NET home page to download the full source so you
can see how it's done. There's also a non-EasyObjects example in the
Data Access Quick Start.
HTH
Matthew Noonan
Noonan Consulting Inc.
EasyObjects.NET - The O/RM architecture for the Enterprise Library