I need a little advice where I could be going wrong.. Below is the following code which works fine as long as I 'Comment out' the "cashDA.Update(cashOrdersDS.Tables["cashOrders"]);"
Current Delete Button Code:
private void btnOrderDelete_Click(object sender, EventArgs e)
{
System.Data.OleDb.OleDbCommandBuilder cb;
cb = new System.Data.OleDb.OleDbCommandBuilder(cashDA);
if (dataGridView2.SelectedRows.Count > 0)
{
cashOrdersTable.Rows.RemoveAt(dataGridView2.SelectedRows[0].Index);
//cashDA.Update(cashOrdersDS.Tables["cashOrders"]);
MessageBox.Show("Record Deleted");
}
else
{
MessageBox.Show("Please Select a row");
}
}
If I enable the "cashDA.Update(cashOrdersDS.Tables["cashOrders"]);" code snippet it errors with the following message:
Value cannot be null.
Parameter name: dataTable
I have uploaded a Screenshot of the Error also.
Any help please??

New Topic/Question
Reply



MultiQuote





|