i made a login table and i am filling records in it through my datagridview but when i delete all the records and make the table empty and then when i put the record in the login table it takes 1 no ahead of last deleted record .i want it to start the id column of login table from 1 again whent it is empty.i am using sql express 2008

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
        Dim i As Integer
        i = DataGridView1.CurrentRow.Index
        TxtId.Text = DataGridView1.Item(0, i).Value
        TxtUsername.Text = DataGridView1.Item(1, i).Value
        TxtPassword.Text = DataGridView1.Item(2, i).Value
        If DataGridView1.Item(0, 0).Value = vbEmpty Then
            DataGridView1.Item(0, 0).Value=initialize

End If
5 Years
Discussion Span
Last Post by Reverend Jim

You should truncate the table to get the ID back to 1. If the Id column is set to increment seed.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.