I have 5 field:
SNo Month Qty Rate Total
My problem is that when i delete record 2 from database and datagridview SNo field not come in order. Serial number field come like bellow that
1
3
4
5
My coding is bellow:
If dgvSale.SelectedRows.Count = 0 Then
Exit Sub
End If
If MsgBox("Are you sure to delete", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Delete") = MsgBoxResult.Yes Then
Dim SNo As String = dgvSale.SelectedRows(0).Cells(0).Value
Try
' Remove the item
Me.Tbl_SaleTableAdapter.DeleteQuery(SNo)
Me.Tbl_SaleTableAdapter.Fill(Me.Ds_Sale.tbl_Sale)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
Exit Sub
End If
Plz help me