Updating Row Data

You can use SQLFCommandBuilder to update, delete, and insert rows that are stored in a SQLFDataAdapter object.

The following example uses an SQLFDataAdapter object to store the contents of a table, and then update row data.
string sqlfHost = "localhost";
int sqlfPort = 1527;
string connectionStr = string.Format(@"server={0}:{1}", sqlfHost, sqlfPort);

SQLFClientConnection connection = null;

try
{
    connection = new SQLFClientConnection(connectionStr);

    SQLFCommand command = connection.CreateCommand();
    command.CommandType = CommandType.Text;
    command.CommandText = @"SELECT unit_cost, retail_price
                           FROM product WHERE product_id=<id>";

    connection.Open();

    // Create adapter and populate the DataTable object
    SQLFDataAdapter adapter = command.CreateDataAdapter();
    DataTable table = new DataTable("product");
    adapter.Fill(table);

    // Generate update command
    SQLFCommandBuilder builder = new SQLFCommandBuilder(adapter);
    adapter.UpdateCommand = builder.GetUpdateCommand();

    // Modify product pricing
    table.Rows[0]["unit_cost"] = 99.99;
    table.Rows[0]["retail_price"] = 199.99;

    // Update the underlying table
    adapter.Update(table);
}
catch (Exception e)
{
    ///
    /// Log or re-throw exception
    /// 
}
finally
{
    connection.Close();
}