OledbCommand parameters only take ? style parameters.
Although this is what MSDN says, but when you test this you'll notice that named parameters are supported also... The only thing is that the name of the parameter doesn't need to be the same as the name of the parameter in the parametercollection, The parameters
must be added in the same order they (first) appear in the command....
diyaa jamal
Member
195 Points
140 Posts
@Param for Access Databass
Mar 12, 2012 08:06 PM|LINK
Hello All,
I have DataSet And add access database and I want to selcet from tabel by @Param
This the code
SELECT tblname.name, tblname.office, tblname.fax, tblname.another, tblcat.cat_name FROM (tblname INNER JOIN tblcat ON tblname.cat_id = tblcat.cat_id) WHERE (tblname.name = @Param)Menno van de...
Contributor
2764 Points
391 Posts
Re: @Param for Access Databass
Mar 12, 2012 08:41 PM|LINK
OledbCommand parameters only take ? style parameters. Replace your @Param by ?, and pass in your parameters in the right order.
Menno
diyaa jamal
Member
195 Points
140 Posts
Re: @Param for Access Databass
Mar 12, 2012 08:56 PM|LINK
Thank you it's work :)
hans_v
All-Star
35986 Points
6550 Posts
Re: @Param for Access Databass
Mar 12, 2012 09:49 PM|LINK
Although this is what MSDN says, but when you test this you'll notice that named parameters are supported also... The only thing is that the name of the parameter doesn't need to be the same as the name of the parameter in the parametercollection, The parameters must be added in the same order they (first) appear in the command....