CODES:
Private Sub Reset_Click(sender As Object, e As EventArgs) Handles Reset.Click
Using connection As New SqlConnection("Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\studentD.mdf;Integrated Security=True")
connection.Open()
Dim update1 As String = "DBCC CHECKIDENT (userTD, RESEED, 0)"
Dim command1 As New SqlCommand(update1, connection)
command1.ExecuteNonQuery()
connection.Close()
End Using
End Sub
Note: YOU NEED TO DELETE ALL RECORDS BEFORE PROCEED TO RESET
No comments:
Post a Comment