Maximus007
Technical User
I have been trying to figure this out for quite some time. Any help is greatly appreciated.
error:Incorrect syntax near the keyword 'And'
Code:
Dim strAddSQL As String
strAddSQL = ("Update Servers set ServerName='" & txtServerName.Text & "' And DateRegistered='" & Date.Today & "'")
Response.Write(strAddSQL)
Response.End()
Dim strAddCmd As SqlCommand
strAddCmd = New SqlCommand(strAddSQL, strAddConn)
strAddConn.Open()
strAddCmd.ExecuteNonQuery()
strAddConn.Close()
error:Incorrect syntax near the keyword 'And'
Code:
Dim strAddSQL As String
strAddSQL = ("Update Servers set ServerName='" & txtServerName.Text & "' And DateRegistered='" & Date.Today & "'")
Response.Write(strAddSQL)
Response.End()
Dim strAddCmd As SqlCommand
strAddCmd = New SqlCommand(strAddSQL, strAddConn)
strAddConn.Open()
strAddCmd.ExecuteNonQuery()
strAddConn.Close()