Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

RE: Parameters with ? Not working in MySQL Connector Net 1.0.9 while with @ are working

From: Peter de Bruine <p.debruine(at)giscare.nl>
Date: Thu Aug 23 2007 - 05:43:45 EDT


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@nefacomp.net] Verzonden: donderdag 23 augustus 2007 11:22 Aan: Peter de Bruine
CC: dotnet@lists.mysql.com
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@no.spam.please.giscare.nl.thank.you
>
>
>

-- 
MySQL on .NET Mailing List
For list archives: 
http://lists.mysql.com/dotnet
To unsubscribe:    
http://lists.mysql.com/dotnet?unsub=p.debruine@giscare.nl



-- 
MySQL on .NET Mailing List
For list archives: 
http://lists.mysql.com/dotnet
To unsubscribe:    
http://lists.mysql.com/dotnet?unsub=lists@pantek.com
Received on Thu Aug 23 05:43:57 2007
Do you need help?X

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:15:41 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library