Hello all,
When I'm trying to update a selected row, only the first row in the table shows the update no matter where I am at in the table.
The selected row to update doesn't change instead the update is shown allways in the first row.
I've noticed that when I press my "move next" or "move previous" buttons, I can scroll up and down my TABLE, but the "ID" number column which is the identity column not being updated accordingly.
I think my problem is in the scrolling through the table with the buttons.
How can I synchronize my scrolling through the table with updating the "ID" number????
Rakesh Jha85 reputationPosted Sep 30, 2010, 5:10 AM EDT
✓ Accepted answer0
Actually you are always refresh your datagridview, because of that it always update your first row of table. you should use following command
WorldDA.UpdateCommand.Parameters.Add("@ID", SqlDbType.Int).Value = this.RaceDGView["ID", RaceDGView.SelectedCells[0].RowIndex].Value;
Rakesh Jha85 reputationPosted Sep 30, 2010, 5:10 AM EDT
Actually you are always refresh your datagridview, because of that it always update your first row of table. you should use following command
WorldDA.UpdateCommand.Parameters.Add("@ID", SqlDbType.Int).Value = this.RaceDGView["ID", RaceDGView.SelectedCells[0].RowIndex].Value;
Lior24 reputationPosted Sep 30, 2010, 6:46 AM EDT
That helped!!!