Hi all, I am attempting to figure out how to repeat an iteration of a loop. I'm hoping that somone knows how to do this.
Basically, I have a datagridview with data in it. I am useing a For Each loop to iterate through each row, and then determine if that row exists in my database. This works perfectly. The issue is that when I determine that a row already exists in the database, I need to delete it from the datagridview. I have been using the datagridview.rows.remove command, but when I do that, the loop skips a line, since it is a for each loop, depending on the rows.
Does anyone know a way around this? I would like to be able to tell the loop to repeat the current row, after the row is deleted (since it will actually be a new row), but I do not know how to tell the loop to do that.
Any ideas?
Thanks!
Basically, I have a datagridview with data in it. I am useing a For Each loop to iterate through each row, and then determine if that row exists in my database. This works perfectly. The issue is that when I determine that a row already exists in the database, I need to delete it from the datagridview. I have been using the datagridview.rows.remove command, but when I do that, the loop skips a line, since it is a for each loop, depending on the rows.
Does anyone know a way around this? I would like to be able to tell the loop to repeat the current row, after the row is deleted (since it will actually be a new row), but I do not know how to tell the loop to do that.
Any ideas?
Thanks!