Adding Rows to a Table

You can use GFXDCommandBuilder to update, delete, and insert rows that are stored in an GFXDDataAdapter object.

The following example uses a GFXDDataAdapter object to store the contents of a table, and then insert new rows.
string gfxdHost = "localhost";
int gfxdPort = 1527;
string connectionStr = string.Format(@"server={0}:{1}", gfxdHost, gfxdPort);

GFXDClientConnection connection = null;

try
{
    connection = new GFXDClientConnection(connectionStr);

    GFXDCommand command = connection.CreateCommand();
    command.CommandType = CommandType.Text;
    command.CommandText = @"SELECT * FROM product";

    connection.Open();

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

    // Generate update command
    GFXDCommandBuilder builder = new GFXDCommandBuilder(adapter);
    adapter.InsertCommand = builder.GetInsertCommand();

    // Create new product row
    DataRow row = table.NewRow();
    row[0] = <product_id>;
    row[1] = <...>;
    row[2] = <...>;
    ...

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