P
pplppp
I have a windows form application getting data from an access database
file using dataadapters, here are the objects I have:
mydataset - mydataTable - mydataview
I use the dataview to find the records I want and bind it to a windows
form control.
anyway, my problem is, when I use the following code to remove a
record:
DataRow[] rows = myDataTable.Select("key="+key);
myDataTable.RemoveDataRow(rows[0]);
then I call myDataSet.HasChanges(), it returns false?! GetChanges()
return null as well. but if I replace the code with
int index = myDataView.Find(key);
myDataView.Delete(index);
then myDataSet.HasChanges() return true
can anyone tell me why I can't delete the rows from the datatable? or
did I do something wrong?
thanks
file using dataadapters, here are the objects I have:
mydataset - mydataTable - mydataview
I use the dataview to find the records I want and bind it to a windows
form control.
anyway, my problem is, when I use the following code to remove a
record:
DataRow[] rows = myDataTable.Select("key="+key);
myDataTable.RemoveDataRow(rows[0]);
then I call myDataSet.HasChanges(), it returns false?! GetChanges()
return null as well. but if I replace the code with
int index = myDataView.Find(key);
myDataView.Delete(index);
then myDataSet.HasChanges() return true
can anyone tell me why I can't delete the rows from the datatable? or
did I do something wrong?
thanks