|
-
Oct 8th, 2016, 10:01 AM
#1
[RESOLVED] MySQL parameter is not a parameter
Ladies and Gentlemen, good morning.
I have the following MYSQL statement that runs fine outside of my application (i.e. in some other sql front end like Heidi, mySQL workbench, etc)...
SQL Code:
SET @rowNum=0; SELECT CONCAT('tray ',@rownum:=@rownum + 1,' - ' ,quantity, ' screws') as title,imagePath as path FROM tray_test_table WHERE lotID=96 ORDER BY timestamp ASC
When I run it in my .net application I get an exception because @rownum is being considered a parameter. Has anyone encountered this, and might anyone know of a work around?
Thanks for looking.
kevin
Last edited by kebo; Oct 8th, 2016 at 10:18 AM.
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Oct 8th, 2016, 10:40 AM
#2
Re: MySQL parameter is not a parameter
Kevin,
I found this: How can I use a MySql User Defined Variable in a .NET MySqlCommand?
I have to add
;Allow User Variables=True
to the connection string
-
Oct 8th, 2016, 11:25 AM
#3
Re: MySQL parameter is not a parameter
Excellent find my friend 
thanks
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|