This is a discussion on Using Transactions to Insert Data to Db2 Database within the DB2 forums, part of the Database Server Software category; --> Hi All I am trying to insert data within a transaction, into a Db2 database from asp.net. I have ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi All I am trying to insert data within a transaction, into a Db2 database from asp.net. I have created a System DSN using ISeries Access Driver(32 bit) for Windows. I am then connecting to it using Microsoft .Net data provider from asp.net. I am able to insert data by using connection and comand object without the transaction. But the PROBLEM comes when i try to put the INSERT query execution within a Transaction. Like the following cnOdbc = New OdbcConnection("DSN=TEST;UID=ABCD;PWD=1234") cnOdbc.Open() cmdOdbc.Connection = cnOdbc tranODBC = cnOdbc.BeginTransaction(IsolationLevel.ReadCommitt ed) cmdOdbc.Transaction = tranODBC TRY strSql = "Insert INTO LIBRARYNAME.TABLENAME VALUES('Z','6789','TAPSING')" cmdOdbc.CommandText = strSql cmdOdbc.ExecuteNonQuery() ''ERROR OCCURS ON THIS LINE'' tranODBC.Commit Catch ex as Exception tranODBC.RollBack Finally tranODBC.close ERROR returned is "ERROR [HY000] [IBM][iSeries Access ODBC Driver][DB2 UDB]SQL7008 - <TableName> in <LibraryName> not valid for operation." I will highly appreciate any help on the issue. Vaibhav |