[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Automatic Transactions with ODBC Oracle and SQL DB's

Nick

5/24/2002 4:17:00 PM

I'm trying to implement a solution that uses a transaction
across both a SQL server and an Oracle database. The
solution works across 2 SQL databases, but when an oracle
database is included within the transaction the call to
ExecuteNonSql on the Oracle database throws an error.

Can anyone help? The code extract is detailed below.

[Transaction(TransactionOption.Required)]
public class Nick : ServicedComponent
{
[AutoComplete]
public void Transaction(ListBox listBox1)
{
string connstr = "DSN=misutdsn;";
OdbcConnection Conn2 = new OdbcConnection(connstr);
Conn2.Open();

OdbcCommand CMD2 = Conn2.CreateCommand();

try
{
for (int i=0;i<5;i++)
{
CMD2.CommandText = "insert into categories
values ('" + i.ToString() + "','" + i.ToString() + "')";
CMD2.ExecuteNonQuery();
}
}
finally
{
Conn2.Close();
}
}
}