Cannot do delete with SqlDataSource
-
- Posts: 4
- Joined: Tue 25 Apr 2006 06:37
Cannot do delete with SqlDataSource
I'm now using MySQL 5.0.20a
I can do a select and update from SqlDataSource
I cannot do a delete through SqlDataSource using MySQLDirect .NET version 3.50.
Following is the code and the error I got.
What's the problem I have? Did I do anything wrongly?
Here's is my code:
"
DeleteCommand="DELETE FROM customers WHERE CUST_ID = ?"
ProviderName="" SelectCommand="SELECT * FROM customers"
UpdateCommand="UPDATE customers SET CUST_FIRSTNAME = ?, CUST_LASTNAME = ?, CUST_LAST_UPDATE_DATE = ?, CUST_ADDRESS = ? WHERE CUST_ID = ?" InsertCommand="INSERT INTO customers (CUST_FIRSTNAME, CUST_LASTNAME, CUST_LAST_UPDATE_DATE, CUST_ADDRESS) VALUES (?, ?, ?, ?)">
Here's the error:
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 '?' at line 1
I can do a select and update from SqlDataSource
I cannot do a delete through SqlDataSource using MySQLDirect .NET version 3.50.
Following is the code and the error I got.
What's the problem I have? Did I do anything wrongly?
Here's is my code:
"
DeleteCommand="DELETE FROM customers WHERE CUST_ID = ?"
ProviderName="" SelectCommand="SELECT * FROM customers"
UpdateCommand="UPDATE customers SET CUST_FIRSTNAME = ?, CUST_LASTNAME = ?, CUST_LAST_UPDATE_DATE = ?, CUST_ADDRESS = ? WHERE CUST_ID = ?" InsertCommand="INSERT INTO customers (CUST_FIRSTNAME, CUST_LASTNAME, CUST_LAST_UPDATE_DATE, CUST_ADDRESS) VALUES (?, ?, ?, ?)">
Here's the error:
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 '?' at line 1
Try to add
to the definition of GridView component:
Code: Select all
DataKeyNames="CUST_ID"
Code: Select all