Results 1 to 3 of 3

Thread: [RESOLVED] MySQL parameter is not a parameter

  1. #1

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Resolved [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:
    1. SET @rowNum=0;
    2. SELECT CONCAT('tray ',@rownum:=@rownum + 1,' - ' ,quantity, ' screws') as title,imagePath as path
    3. FROM tray_test_table
    4. WHERE lotID=96
    5. 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

  2. #2
    PowerPoster
    Join Date
    Oct 2010
    Posts
    2,141

    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

  3. #3

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    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
  •  



Click Here to Expand Forum to Full Width