incorrect SQL statement

jnash

Well-known member
Joined
Oct 20, 2006
Messages
111
Programming Experience
Beginner
The SQL is wrong, how do i implement this

dvd is a string

VB.NET:
Dim cmd As New MySqlCommand
        cmd.CommandType = System.Data.CommandType.Text
        cmd.CommandText = "INSERT * from tblstock where StockBarcode = dvd (RentedOut) VALUES ('True')"
        cmd.Connection = TheConnection

        TheConnection.Open()
        cmd.ExecuteNonQuery()
        TheConnection.Close()

thanks alot Jon
 
Invalid syntax.... not surprised..... what is it you are trying to do?

-tg
 
i want to select a record in the table tblRental where its barcode field is "bla bla" and insert the value of its RentedOut field to True
 
INSERT cannot have a WHERE clause - INSERT inserts a record. If you dont want to insert the record, dont run the insert!

i want to select a record in the table tblRental where its barcode field is "bla bla" and insert the value of its RentedOut field to True
Insert inserts records, not values. Insert the value true into what table?

Perhaps you mean you want to UPDATE the exiting field to true, not insert a new record?

www.w3schools.com and learn the basic SQL syntaxes!?
 
Back
Top