Subject | Re: [firebird-support] parametric queries from .NET |
---|---|
Author | Helen Borrie |
Post date | 2012-07-25T00:35:32Z |
At 12:26 PM 25/07/2012, Newbie wrote:
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/firebird-net-provider>,
<mailto:firebird-net-provider-request@...?subject=subscribe>
^heLen^
>how to use parametric queries from .NET with Firebird?More appropriate to ask about this on the firebird-net-provider list:
>I have always been using parameters with stored procedures. like this
> FbCommand cmd = new FbCommand("select * from
>SP_myprocedure(?);");
> cmd.CommandType = CommandType.StoredProcedure;
> cmd.Parameters.Add("@myparameter", FbDbType.Text).Value =
>myparameter;
>
>this works very well. but now I have just a query where I need to add
>several parameter inputs. I have changed the CommandType to Text and
>tried adding parameter into query for example "select field1, field2
>from table1 where field1=:myparameter;"
>
>but can't get it to work. how should it be done?
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/firebird-net-provider>,
<mailto:firebird-net-provider-request@...?subject=subscribe>
^heLen^