One clarification, in the edit code:
private void btnOrderEdit_Click(object sender, EventArgs e)
{
int i, j;
i = dataGridView2.CurrentCell.RowIndex;
j = dataGridView2.CurrentRow.Index;
System.Data.OleDb.OleDbCommandBuilder cb;
cb = new System.Data.OleDb.OleDbCommandBuilder(cashDA);
DataRow dRow2 = cashOrdersDS.Tables["cashOrders"].Rows[0];
dRow2["cashQTY"] = Int64.Parse(txtOrderQTY.Text);
dRow2["cashDescription"] = txtBoxDescrip.Text.ToString();
dRow2["cashSupplier"] = txtBoxSupplier.Text.ToString();
dRow2["cashDate"] = dateTimePicker1.Value.ToString();
dRow2["cashCost"] = Convert.ToDouble(txtBoxCost.Text);
dRow2["cashSell"] = Convert.ToDouble(txtBoxSell.Text);
dRow2["cashAccountRef_FKID"] = Int64.Parse(textBox1.Text);
/// ###########################################################
/// Re-added dRow2 to the dataset after population else it does absolutely nothing, change #8
/// ###########################################################
cashOrdersDS.Tables["cashOrders"].Rows.Add(dRow2);
/// ###########################################################
/// Added connection open and close around the update call, change #9
/// ###########################################################
cashCustom.Open();
cashDA.Update(cashOrdersDS, "cashOrders");
cashCustom.Close();
MessageBox.Show("Data Updated");
}
On line 8 it sets dRow2 to a specific row (always the first in table) is this intentional? As surely it will always just edit that one entry. Should it not be off a selected index or something?