SubSonic Forums
All Your Database Are Belong To Us

MySQL, Stored procedures with parameters and @ signs, upgrading to 2.1

Latest post 08-27-2008 5:08 PM by Fordy. 0 replies.
  • 08-27-2008 5:08 PM

    • Fordy
    • Not Ranked
    • Joined on 08-27-2008
    • Posts 2

    MySQL, Stored procedures with parameters and @ signs, upgrading to 2.1

    Having just upgraded to 2.1 and run subcommander I found that all the methods in StoredProcedures.cs that use parameters have parameter names that are wrong.

    They read :    

                sp.Command.AddParameter("?@_startPage", StartPage, DbType.Int32, null, null);

    When they should read :

                sp.Command.AddParameter("?_startPage", StartPage, DbType.Int32, null, null);
             
     Where's the extra @ sign come from??

     The problem seems to be with the MYSQLDataProvider.cs

    As a quick fix I changed

    GetSPParams in  MYSQLDataProvider.cs to read like so :

       if (param.ParameterName.StartsWith("@"))
                        {
                            row[0] = param.ParameterName.Substring(1);
                        }
                        else {
                            row[0] = param.ParameterName;
                        }

    Not pretty, but it works.

    So am I doing something else wrong to cause the additional @ sign ? Is it a problem with my procedures? Just wondered if anybody has a better idea than me. This wasn't the case with SubSonic 2.0.3. Thanks in advance for any comments.

Page 1 of 1 (1 items) | RSS