Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Auto Serial Number Problem

$
0
0

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


Viewing all articles
Browse latest Browse all 8156

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>