how to re-initialize the id colum of databasetable by 1 again when all the table records are deleted
how to re-initialize the id colum of databasetable by 1 again when all the table records are deleted
i want to re-initialize my id column of login table by 1 again when all the records are deleted ,i tried the code given below ,i am using sql-express 2008
[code]
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
[/code]
[code]
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
[/code]
This discussion has been closed.