Cannot do delete with SqlDataSource

Cannot do delete with SqlDataSource

Postby ballball2k » Tue 25 Apr 2006 07:52

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="<%$ ConnectionStrings:testdbConnectionString.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
ballball2k
 
Posts: 4
Joined: Tue 25 Apr 2006 06:37

Postby Alexey » Tue 25 Apr 2006 09:24

There is no errors in this code. At least it works fine here.
Send us small test project if possible to reproduce the problem; it is
desirable to use 'test' schema objects, otherwise include definition of
your own database objects. Do not use third party components.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby ballball2k » Tue 25 Apr 2006 10:02

Where should I send the project to?
ballball2k
 
Posts: 4
Joined: Tue 25 Apr 2006 06:37

Postby Alexey » Tue 25 Apr 2006 10:16

Please use e-mail address provided in the registration letter or in readme.txt file.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby ballball2k » Tue 25 Apr 2006 10:30

Email sent.
ballball2k
 
Posts: 4
Joined: Tue 25 Apr 2006 06:37

Postby Alexey » Wed 26 Apr 2006 07:47

We reproduced the problem and now investigating it. You will be notified on results as soon as possible.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Alexey » Wed 03 May 2006 12:01

Try to add

Code: Select all
DataKeyNames="CUST_ID" 


to the definition of GridView component:

Code: Select all
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Alexey » Tue 22 Aug 2006 09:32

Do you have appropriate record about MySQLDirect data provider in section of machine.config file?
What version of MySQLDirect do you use?
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL