Im always getting Invalid Column, check the database and it's all correct.

     Dim borrowed As String = "Yes"
        dataopen()
        comm.Connection = conn
        comm.CommandText = "UPDATE Equipment SET Borrowed = '" & borrowed & "' WHERE EQID = '" & eid & "'"
        comm.ExecuteNonQueryAsync()
        comm.Dispose()
        conn.Close()

Recommended Answers

Please post the SQL code to create the database.

Jump to Post

All 3 Replies

What's the error? What is the datatype of Borrowed Fields? a bit or String? Try to remove the single quote from the query, on the Borrowed value

  Dim borrowed As String = "Yes"
        dataopen()
        comm.Connection = conn
        comm.CommandText = "UPDATE Equipment SET Borrowed = " & borrowed & " WHERE EQID = '" & eid & "'"
        comm.ExecuteNonQueryAsync()
        comm.Dispose()
        conn.Close()

put the value borrowed in single quotes...

UPDATE Equipment SET Borrowed = '" & borrowed & "' WHERE EQID = '" & eid & "'"
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.