There is no row at position 1.
-
ok, I have a datagridview and in that a delete row button. When I click the delete button when there is no data, the program crashes. Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick If e.ColumnIndex <> 7 Then Exit Sub End If VoicemailDataSet.Message.Rows(DataGridView1.CurrentRow.Index).Delete() THE ERROR COMES IN HERE MessageTableAdapter.Update(VoicemailDataSet.Message) End Sub What I need is if someone decides to push the delete button despite the fact there is no information that the program does not crash. In essence I just really need some help with error handling. Thanks!
-
ok, I have a datagridview and in that a delete row button. When I click the delete button when there is no data, the program crashes. Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick If e.ColumnIndex <> 7 Then Exit Sub End If VoicemailDataSet.Message.Rows(DataGridView1.CurrentRow.Index).Delete() THE ERROR COMES IN HERE MessageTableAdapter.Update(VoicemailDataSet.Message) End Sub What I need is if someone decides to push the delete button despite the fact there is no information that the program does not crash. In essence I just really need some help with error handling. Thanks!
This is not a Visual Studio issue, please post in the forum appropriate to the language you are using: looks to me like VB.
Unrequited desire is character building. OriginalGriff
-
ok, I have a datagridview and in that a delete row button. When I click the delete button when there is no data, the program crashes. Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick If e.ColumnIndex <> 7 Then Exit Sub End If VoicemailDataSet.Message.Rows(DataGridView1.CurrentRow.Index).Delete() THE ERROR COMES IN HERE MessageTableAdapter.Update(VoicemailDataSet.Message) End Sub What I need is if someone decides to push the delete button despite the fact there is no information that the program does not crash. In essence I just really need some help with error handling. Thanks!