chadmanvb
asked on
update sql with vb.net 2.0
I'm new to sql and need to update a few columns in 1 row. I can update a single column, but have not figured out how to do multiple columns. What do I have wrong?
This works
dbcmd.CommandText = "Update Workstations Set USERNAME='" & strUserName & "' Where NAME='" & testme & "'"
This does not work.
dbcmd.CommandText = "Update Workstations Set USERNAME='" & strUserName & "' Set LOGTYPE='" & strType & "' Set CHECKTIME='" & strDate & "' Where SERIAL='" & testme & "'"
It just tells me there is an error near the "=". I checked and my column names are correct
This works
dbcmd.CommandText = "Update Workstations Set USERNAME='" & strUserName & "' Where NAME='" & testme & "'"
This does not work.
dbcmd.CommandText = "Update Workstations Set USERNAME='" & strUserName & "' Set LOGTYPE='" & strType & "' Set CHECKTIME='" & strDate & "' Where SERIAL='" & testme & "'"
It just tells me there is an error near the "=". I checked and my column names are correct
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER