I m trying to do make a simple UPDATE using this:

this.BindingContext[ds.Tables[0]].EndCurrentEdit();
da.Update(ds.Tables[0]);

My BindingContext is working fine and i can navigate trough the records, but when i try to update my data into the database nothing happens!

This is my code:

            try {
                this.BindingContext[ds.Tables[0]].EndCurrentEdit();
                da.Update(ds,ds.Tables[0].TableName);
            } catch (Exception ex) {
                MessageBox.Show(ex.ToString());
            }



I even tried this:

           cmdUpdate.Parameters.Add("@CLI_COD", FbDbType.Integer);
            cmdUpdate.Parameters.Add ("@CLI_NOME", FbDbType.VarChar);
            cmdUpdate.Parameters.Add("@CLI_SOBRENOME", FbDbType.VarChar);

And i tried to write the query in this way:

UPDATE CLIENTES SET CLI_NOME= ?, CLI_SOBRENOME = ? WHERE CLI_COD = ?

And this way:

UPDATE CLIENTES SET CLI_NOME= @CLI_NOME, CLI_SOBRENOME = @CLI_SOBRENOME WHERE CLI_COD = @CLI_COD

What is pissing me off, is that i dont get ANY erros.

And the problem isnt the connection, i tried: cn.Open() before the da.Update, and it gave me an error: Connection already opened.



What is wrong with this?


Thanx in advance for any help.


Reply via email to