Hello,

I wrote the following function:

public void SaveChanges(DataTable table)
{

  FbConnection myConn = new FbConnection(this.ConnectionString);
  myConn.Open();
  FbTransaction myTxn = myConn.BeginTransaction();
  FbDataAdapter myDataAdapter = new FbDataAdapter(new
FbCommand(string.Format("SELECT * FROM {0} WHERE 0=1",table.TableName),
   myConn,myTxn));

  FbCommandBuilder custCB = new FbCommandBuilder(myDataAdapter);
  myDataAdapter.UpdateCommand = custCB.GetUpdateCommand();
  myDataAdapter.UpdateCommand.Transaction = myTxn;

  myDataAdapter.Update(table);

  myTxn.Commit();

  myConn.Close();
}

The function does not work however correctly.
The UpdateCommand from the DataAdapter has the correct statement, but
the data was not updated.
If I fill the table directly after the creation of the adapter, the data
are updated.
That is however not my goal.

The same code with the OleDbProvider and a Access-Database works
correctly (with the OleDbProvider-Objects and without transaction).

I use the Firebird ADO.NET Provider 2.0 RC2 in VS2005.

What can I do, so that this function works correctly?

Best regards
Guido Franke




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to