Click here to Skip to main content
15,896,500 members

Comments by Member 9054838 (Top 1 by date)

Member 9054838 31-May-12 11:21am View    
Many thanks. i already saw the example and here is my code: It doesn't save. here is my code:
private void table1BindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.table1BindingSource.EndEdit();
this.table2BindingSource.EndEdit();

dbaccess1DataSet.table2DataTable modifiedtable2 = (dbaccess1DataSet.table2DataTable)
dbaccess1DataSet.table2.GetChanges(DataRowState.Modified);
dbaccess1DataSet.table2DataTable deletedtable2 = (dbaccess1DataSet.table2DataTable)
dbaccess1DataSet.table2.GetChanges(DataRowState.Deleted);

dbaccess1DataSet.table2DataTable newtable2 = (dbaccess1DataSet.table2DataTable)
dbaccess1DataSet.table2.GetChanges(DataRowState.Added);

if (modifiedtable2 != null)
{
table2TableAdapter.Update(modifiedtable2);
}
if (deletedtable2 != null)
{
table2TableAdapter.Update(deletedtable2);
}
if (newtable2 != null)
{
table2TableAdapter.Update(newtable2);
}

dbaccess1DataSet.AcceptChanges();
}