Bug #39052 Visual studio dataset designer won't allow ?parameter syntax
Submitted: 26 Aug 2008 16:32 Modified: 26 Aug 2008 17:25
Reporter: Mark Rabjohn Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:5.2.3 OS:Windows
Assigned to: CPU Architecture:Any
Tags: connector, MySQL, Parameter, query, windows

[26 Aug 2008 16:32] Mark Rabjohn
Description:
I'm using full Visual Studio 2005 on Vista Business - fully patched.

I have just installed a new machine from scratch and noticed that Connector/Net 5.2.3 is available.

On opening my Dataset design, I find that I cannot add new queries requiring parameters.

This worked on Vista Business on Connector/Net 5.1.6, so somethings gone wrong somewhere.

Whilst I'm on here - the LIMIT/OFFSET syntax cannot be used either, and MySQL has no TOP command.

How to repeat:
A simple example:

SELECT * FROM `contents` WHERE `ID` = ?id

Generates the error:

Error in WHERE clause near 'id'.
Unable to parse query text.

Swapping the ? for an @ passes this test, but the command won't run on MySQL and the command does not get compiled into the DAL.

Suggested fix:
I don't know how the low level stuff works here, but I would suspect that some form of parsing is used.

It would be ideal if the parser could validate MySQL code when using a MySQL connector even if it has to work around/bypass some Microsoft code to do so.

For now, I'll go back to Connector/NET 5.1.6
[26 Aug 2008 16:38] Reggie Burnett
Mark

@ syntax does work with 5.2.  We have changed to now suggesting use of @ syntax for parameters starting with 5.2.
[26 Aug 2008 17:05] Mark Rabjohn
I've just installed the 5.1.7 release, and the parameters are working now, so it's probably an issue with the 5.2 branch of the connector.
[26 Aug 2008 17:25] Mark Rabjohn
Hi Reggie,

I think there is still a bug, as stated before:

"Swapping the ? for an @ passes this test, but the command won't run on MySQL and the command does not get compiled into the DAL."

i.e. if I use the @notation, the wizard appears to add the command, but the DAL does not compile, and the preview data... command crashes with an internal error.

I would guess that part of the connector has been changed such that it expects @parameter, but other parts (or the database) are still expecting ?parameter, and the one is not being converted to the other.