In my table called “test01” I keep getting an error when I run the site.
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near ‘[test01]’ at line 1Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.Exception Details: MySql.Data.MySqlClient.MySqlException: You have an
error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near ‘[test01]’ at
line 1
From what I can see it is because the code that it is generating when I bring toolbox items and drop them in design view is this:
SelectCommand="SELECT * FROM [test01]"
DeleteCommand="DELETE FROM [test01] WHERE [test_id] = ?"
InsertCommand="INSERT INTO [test01] ([test_id], [TestName], [TestDescription]) VALUES (?, ?, ?)"
UpdateCommand="UPDATE [test01] SET [TestName] = ?, [TestDescription] = ? WHERE [test_id] = ?">
When I remove the [ ] brackets it works fine. Is there something I can do to change the functionality of this?
I hope this question makes sense!
Brackets are a MSSQL way of qualifying stuff. You want backticks for MySQL.