I have tried everything, googled for days, but nothing I found helped me.
I have Oracle 9i db, table TIME_UNITS that have several fields - for my purposes I use only 3, defined as:
CODE - VARCHAR2(6)
, FOR_IN - VARCHAR2(1)
, FOR_OUT - VARCHAR2(1)
. My code is:
string strConString = "provider=MSDAORA;DSN=myDSN;user id=myUser;password=myPassword";
string strQuery = "UPDATE TIME_UNITS SET FOR_IN='Y', FOR_OUT='Y' WHERE CODE='202003'";
using (OleDbConnection oleDbConn = new OleDbConnection(strConString ))
using (OleDbCommand cmd = new OleDbCommand(strQuery, oleDbConn))
{
oleDbConn.Open();
cmd.Transaction = oleDbConn.BeginTransaction();
int rows = cmd.ExecuteNonQuery();
cmd.Transaction.Commit();
oleDbConn.Close();
}
ExecuteNonQuery returns one row, but when I look into db using sqldeveloper nothing is changed. The same statement works perfectly in sqldeveloper using the same credentials. I've tried with and without transaction begin-commit, but still no change in database. What am I doing wrong?