I want to delete (for example) top 5 rows in my SQL Server database. I used this code shown below, but it does not work. How may I get this?
Dim con As New SqlConnection(connectionString)
Using cmd = New SqlCommand()
cmd.CommandText = "DELETE From PubTb TOP 5"
cmd.Connection = con
con.Open()
Dim numberDeleted As Integer = cmd.ExecuteNonQuery()
con.Close()
End Using