HELLO! I've been debugging my code for an hour now. seriously.
So I have this string:
SQLString = "UPDATE `etmsystem`.`main` SET `timeIn` = '22:00' WHERE `main`.`serialNo` = '70002B4A8F9E'"
actually the TIME and the SERIAL NO. here is to be represented by a variable. But I changed the code into that to see that there is something weird happening.
Here are the steps that I've done:
1. search the web. --- done.
2. remove the `
3. remove the etmsystem (database name) and remove the main/
4. check for whitespaces.
5. EXECUTE THE CODE (above) IN SQL MODE IN LOCALHOST.
when I run the code in localhost phpmyadmin, it actually works.
but in VB.net...no.
by the way, serialNo column in my database is a VARCHAR which has 12 length.
I've been making programs with mySQL connection ever since I learned VB.net (last two years) hehe.
Other sqlstrings are working in my program, like:
serverFrm.SQLString = "DELETE FROM main WHERE serialNo = " + serverFrm.toDelete.ToString + ";" serverFrm.SQLCommand = New MySqlCommand(serverFrm.SQLString, serverFrm.SQLConnection) serverFrm.SQLDataReader = serverFrm.SQLCommand.ExecuteReader()
ps: error is
You have an error in your SQL syntax; check the manual that corresponds.......to use near 'serialNo = 70002B27ffawfaw' at line 1
for me it is weird, really. but I know I just can't see a very small mistake here.
Edited 2 Years Ago by glenn_boy13: error forgot