Hi,
I have got a problem updating my oracle database;When i run the code, there is no error detected but when I open the database, no changes have been made. Can someone hemp me please? Here is the code:
string connString = "DSN=cbc;UID=cbc;PWD=cbc";
OdbcConnection cnOracle = new OdbcConnection(connString);
cnOracle.Open();
OdbcCommand cmOracle = cnOracle.CreateCommand();
cmOracle.CommandText = "update mouvement set rapprocher = 1 where numerocompte = '"+code+"'";
MessageBox.Show(" comptes ont été rapprochés avec succès0000!!"); //to insure no errors during the insertion
cmOracle.ExecuteNonQuery();
MessageBox.Show(" comptes ont été rapprochés avec succès11111!!");//to insure no errors during the insertion
cnOracle.Close();
Loading
Master BillaPosted Sep 17, 2009, 10:32 PM
1. add try catch to find correct query and copy that and paste in oracle query tool.
2. sometimes oracle may be lock the database commit. so click just refresh or commit icon in TOAD.
thank you
Mahesh ChandPosted Sep 17, 2009, 9:23 PM
string connString = "DSN=cbc;UID=cbc;PWD=cbc";
OdbcConnection cnOracle = new OdbcConnection(connString);
try
{
cnOracle.Open();
OdbcCommand cmOracle = cnOracle.CreateCommand();
cmOracle.CommandText = "update mouvement set rapprocher = 1 where numerocompte = '"+code+"'";
MessageBox.Show(" comptes ont été rapprochés avec succès0000!!"); //to insure no errors during the insertion
cmOracle.ExecuteNonQuery();
MessageBox.Show(" comptes ont été rapprochés avec succès11111!!");//to insure no errors during the insertion
cnOracle.Close();
}
catch(Exception exp)
{
string str = exp.Message;
}