Hope I can get help. Each time I write an Update query I have a habit of forgetting to add the where clause. I have destroyed my test records many many times.
Therefore is there a way to count the number of rows that will be updated so I can add error or warning that more that one record is being updated.
Thanks & Regards
eg: of my updateclass
Private Sub updateclass(ByVal queryString As String)
Label1.Text = ""
Try
Using connection As New Data.SqlClient.SqlConnection(connectionString)
Dim command As New Data.SqlClient.SqlCommand(queryString, connection)
command.Connection.Open()
command.ExecuteNonQuery()
command.Connection.Close()
End Using
Catch b As System.Data.SqlClient.SqlException
errorlength = InStr(b.Message, ".")
errormessage = Microsoft.VisualBasic.Left(b.Message, errorlength)
Label1.Text = "Error-119: " & errormessage
Exit Sub
End Try
End Sub