C
Chris Stone
In the following function, I always get rows affected = 2 although I know
I'm only updating one record. Can anyone please give me an idea why rows
affected is not = 1?
Thank You for any assistance!!!
Private Function DeleteRecord(ByVal strRecID As String) As Boolean
Dim Conn As New
SqlConnection(ConfigurationSettings.AppSettings("ConnectString"))
Dim Command As New SqlCommand("UPDATE tblDepartments SET ActiveRecord =0
WHERE DeptID=" & strRecID, Conn)
Dim intRowsAffected As Integer
Conn.Open()
intRowsAffected = Command.ExecuteNonQuery()
'Response.Write(intRowsAffected)
If (intRowsAffected = 1) Then
Return True
Else
Return False
End If
End Function
I'm only updating one record. Can anyone please give me an idea why rows
affected is not = 1?
Thank You for any assistance!!!
Private Function DeleteRecord(ByVal strRecID As String) As Boolean
Dim Conn As New
SqlConnection(ConfigurationSettings.AppSettings("ConnectString"))
Dim Command As New SqlCommand("UPDATE tblDepartments SET ActiveRecord =0
WHERE DeptID=" & strRecID, Conn)
Dim intRowsAffected As Integer
Conn.Open()
intRowsAffected = Command.ExecuteNonQuery()
'Response.Write(intRowsAffected)
If (intRowsAffected = 1) Then
Return True
Else
Return False
End If
End Function