Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

using BeginTransaction

414151Feb 4 2004 — edited Feb 5 2004
I am using ODP in .net
I get the following compile error
Property or Indexer 'Oracle.DataAccess.Client.OracleCommand.Transaction' Cannot be assigned to - 'it is read only

Oracle.DataAccess.Client.OracleTransaction otUsers;
// create an instance of the connection object
Oracle.DataAccess.Client.OracleConnection objC =
new Oracle.DataAccess.Client.OracleConnection(DL.getConnectString());
// Open the connection
objC.Open();

//Start Transaction
otUsers = objC.BeginTransaction();

//create an instance of the command object giving the procedure name
Oracle.DataAccess.Client.OracleCommand objCommand =
new Oracle.DataAccess.Client.OracleCommand("pgk_MGR.lockUser");
objCommand.Connection = objC;
//assign Transaction
objCommand.Transaction=otUsers;

The error is on the last line
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 4 2004
Added on Feb 4 2004
3 comments
762 views