List:MySQL and .NET« Previous MessageNext Message »
From:Peter de Bruine Date:August 23 2007 9:43am
Subject:RE: Parameters with ? Not working in MySQL Connector Net 1.0.9 while with @ are working
View as plain text  
Thanks for your reply,

I can confirm that this works, but i still don't know why at first it worked
without the question mark in 1.0.7 and now in 1.0.9 it doesn't work anymore.
Can you or somebody else tell me why that is?

Regards
Peter

-----Oorspronkelijk bericht-----
Van: DG @ NEFACOMP [mailto:dg@stripped] 
Verzonden: donderdag 23 augustus 2007 11:22
Aan: Peter de Bruine
CC: dotnet@stripped
Onderwerp: Re: Parameters with ? Not working in MySQL Connector Net 1.0.9
while with @ are working


Use

cmd.Parameters.Add("?someid", MySqlDbType.Int32).Value = someobject.Id;

[[[[ Note the question mark "?" before the parameter name ]]]]


Peter de Bruine wrote:
> Hi all,
>
> We have developed an application which uses the MySQL Connector Net to 
> get data from the database. Recently i upgraded to MySQL Connector Net 
> 1.0.9 and found that the application wasn't working anymore. We got 
> error saying "Parameter '?parametername' must be defined". Here a 
> example:
>
> MySqlCommand cmd = new MySqlCommand("SELECT something FROM sometable 
> WHERE id=?someid", conn);
>
> cmd.Parameters.Add("someid", MySqlDbType.Int32).Value = someobject.Id;
>
> MySqlDataAdapter da = new MySqlDataAdapter(cmd);			
> DataSet ds = new DataSet("sometable");
> da.Fill(ds, 0, 0, "sometable");
>
> This code worked fine until 1.0.9. When we change the ? to @ the code 
> works again. Can anyone explain why this is?
>
> Kind regards
>
> Peter de Bruine p.debruine@stripped
>
>
>   

-- 
MySQL on .NET Mailing List
For list archives: http://lists.mysql.com/dotnet
To unsubscribe:    http://lists.mysql.com/dotnet?unsub=1


Thread
Parameters with ? Not working in MySQL Connector Net 1.0.9 while with @ are workingPeter de Bruine23 Aug
  • Re: Parameters with ? Not working in MySQL Connector Net 1.0.9 whilewith @ are workingDG @ NEFACOMP23 Aug
    • RE: Parameters with ? Not working in MySQL Connector Net 1.0.9 while with @ are workingPeter de Bruine23 Aug
      • Re: Parameters with ? Not working in MySQL Connector Net 1.0.9while with @ are workingDavid Anderson23 Aug
        • RE: Parameters with ? Not working in MySQL Connector Net 1.0.9 while with @ are workingPeter de Bruine23 Aug
          • Re: Parameters with ? Not working in MySQL Connector Net 1.0.9 whilewith @ are workingReggie Burnett23 Aug