row state is always set to modified
-
I am trying to only submit the certain rows from the dataTable that have been modifed with 2 ways to which both of them result in all the rows being submitted. The first way is using the GetChanged method of the dataTable, and it returns all the rows. The second way is using the if myRow.RowState = DataRowState.Modified, and it says they were all modified. I tried to insert this before the fill operation: .AcceptChangesDuringFill = True after having problems, assuming that it was during the fill that the rowState was set to modifed, but no luck. I have also tried after inserting the data into the table: myTable.AcceptChanges. I am pretty sure that nothing else touches the rows after that so they should not get there rowStatus changed. If anyone can see what I am doing wrong, or leaving out I would appreciate the help. Thanks
-
I am trying to only submit the certain rows from the dataTable that have been modifed with 2 ways to which both of them result in all the rows being submitted. The first way is using the GetChanged method of the dataTable, and it returns all the rows. The second way is using the if myRow.RowState = DataRowState.Modified, and it says they were all modified. I tried to insert this before the fill operation: .AcceptChangesDuringFill = True after having problems, assuming that it was during the fill that the rowState was set to modifed, but no luck. I have also tried after inserting the data into the table: myTable.AcceptChanges. I am pretty sure that nothing else touches the rows after that so they should not get there rowStatus changed. If anyone can see what I am doing wrong, or leaving out I would appreciate the help. Thanks
It seems that you are doing something wrong in your code. I have just tried that on my computer and GetChanges() is working just fine. I tried something like this
Me.DataGrid1.DataSource = Me.Dataset11.authors.GetChanges(DataRowState.Modified)
and the GetChanges() returned only the rows that I modified Give me some more of your code if you like and I might find the solution. Better luck next time sony speed -
It seems that you are doing something wrong in your code. I have just tried that on my computer and GetChanges() is working just fine. I tried something like this
Me.DataGrid1.DataSource = Me.Dataset11.authors.GetChanges(DataRowState.Modified)
and the GetChanges() returned only the rows that I modified Give me some more of your code if you like and I might find the solution. Better luck next time sony speedthanks for the help. What seemed to be the problem was that initially I didn't have the acceptChanges() in there and after I inserted it I forgot that I had another method that was stipping out all the null values and that was making chnages once again. All is gooood now.
-
thanks for the help. What seemed to be the problem was that initially I didn't have the acceptChanges() in there and after I inserted it I forgot that I had another method that was stipping out all the null values and that was making chnages once again. All is gooood now.
I am having a hard time getting the getChanges to retrieve the changes that were performed on the last row of the data. Since the user is not able to create rows, nothing really happens when the hit the enter key on the last line. I suppose I could always have an extra blank row at the bottom of the grid, but is there a better way to deal with this?