SCM

[#1000320] XACT_E_NOTSUPPORTED(0x8004D00F).

View Trackers | Bugs | Download .csv | Monitor

Date:
2005-05-20 18:18
Priority:
3
State:
Open
Submitted by:
Dave Cramer (davecramer)
Assigned to:
Nobody (None)
Category:
Standard conformance
Group:
v1.0.0.19
Resolution:
None
 
Summary:
XACT_E_NOTSUPPORTED(0x8004D00F).

Detailed description
public void RunOleDbTransaction(string myConnString)
{
OleDbConnection myConnection = new OleDbConnection(myConnString);
myConnection.Open();

OleDbCommand myCommand = myConnection.CreateCommand();
OleDbTransaction myTrans;

// Start a local transaction
myTrans =
myConnection.BeginTransaction(IsolationLevel.ReadCommitted);
// Assign transaction object for a pending local transaction
myCommand.Connection = myConnection;
myCommand.Transaction = myTrans;

try
{
myCommand.CommandText = "Insert into Region (RegionID,
RegionDescription) VALUES (100, 'Description')";
myCommand.ExecuteNonQuery();
myCommand.CommandText = "Insert into Region (RegionID,
RegionDescription) VALUES (101, 'Description')";
myCommand.ExecuteNonQuery();
myTrans.Commit();
Console.WriteLine("Both records are written to database.");
}
catch(Exception e)
{
try
{
myTrans.Rollback();
}
catch (OleDbException ex)
{
if (myTrans.Connection != null)
{
Console.WriteLine("An exception of type " + ex.GetType() +
" was encountered while attempting to roll
back the transaction.");
}
}

Console.WriteLine("An exception of type " + e.GetType() +
" was encountered while inserting the data.");
Console.WriteLine("Neither record was written to database.");
}
finally
{
myConnection.Close();
}
}

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge