Topobase

Reply
Contributor
satu777
Posts: 14
Registered: ‎02-19-2009
Message 1 of 2 (119 Views)

How to use transaction?

119 Views, 1 Replies
05-22-2009 03:08 AM
How can I use Topobase.Data.Provider.Transaction?

In the Oracle the solution is the follow:
Oracle.DataAccess.Client.OracleTransaction myOracleTransaction = myOraConn.BeginTransaction();
Oracle.DataAccess.Client.OracleCommand _cmd = myOraConn.CreateCommand();
...
myOracleTransaction.Commit();

How can I do it with Topobase data provider? Please send me a short example.
Contributor
satu777
Posts: 14
Registered: ‎02-19-2009
Message 2 of 2 (119 Views)

Re: How to use transaction?

09-08-2009 02:45 AM in reply to: satu777
Solution from myself... maybe if somebody needs this...

String sqlScript = "Select * from Dump";
mySqlConn = new gl2ora.SqlCon(OracleSID, OracleUsername, OraclePassword);
myOraConn = mySqlConn.Make();
Oracle.DataAccess.Client.OracleTransaction myOracleTransaction = myOraConn.BeginTransaction();
Oracle.DataAccess.Client.OracleCommand _cmd = myOraConn.CreateCommand();
_cmd.CommandText = sqlScript;
try
{
_cmd.ExecuteNonQuery();
}
catch (System.Exception _ex)
{
//Error
myOracleTransaction.Rollback();
return false;
}
}
//All done
myOracleTransaction.Commit();

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community