Hello guys. I have an error: I want when I delete a row and if was only one to reseed the ID so I created this:
And using this in the button if the table have no row:
And I have this error:
I have a SQL CE table.
Function ReseedTable(ByVal TableName As String, ByVal Value As Integer) Dim cmd As SqlCeCommand = conn.CreateCommand() Try cmd.CommandText = "DBCC CHECKIDENT('" & TableName & "', RESEED, " & Value & ")" MsgBox(cmd.CommandText) cmd.Prepare() cmd.ExecuteNonQuery() Catch ex As Exception MsgBox(ex.Message & "Eroare46754563453534534") End Try Return 1 End Function
And using this in the button if the table have no row:
ReseedTable(TableName, 1)
And I have this error:
Quote
There was an error parsing the query. [ Token line number = 1, Token line offset = 1, Token in error = DBCC ]
I have a SQL CE table.