[Firebird-net-provider] Calling Parameterized Queries
Hi Listers, This is a pretty basic question, but I haven't found the answer to it yet. In C#, how would one pass a parameter to a parameterized query, such as: SELECT * FROM MyTable WHERE ? Thanks, Roger Roger Montague Waconia, Minnesota USA -- Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Calling Parameterized Queries
Hi Roger, In C#, I code it like this. StringBuilder sqlCommand = new StringBuilder(); sqlCommand.Append(" SELECT * FROM MyTable WHERE ); sqlCommand.Append("Guid = @Guid "); sqlCommand.Append("OR Guid = UPPER(@Guid) "); sqlCommand.Append(";"); FbParameter[] arParams = new FbParameter[1]; arParams[0] = new FbParameter("@Guid", FbDbType.Char, 36); arParams[0].Direction = ParameterDirection.Input; arParams[0].Value = guid.ToString(); Norbert Saint Georges Six Sigma Business Intelligence Analyst Six Sigma Green Rue de la Reine 5 B- 1330 Rixensart Tel. +32 (0)28808810 www.sixsigmagreen.eu De : Roger Montague [mailto:rogermonta...@embarqmail.com] Envoyé : samedi 10 décembre 2011 17:08 À : Firebird-net-provider@lists.sourceforge.net Objet : [Firebird-net-provider] Calling Parameterized Queries Hi Listers, This is a pretty basic question, but I havent found the answer to it yet. In C#, how would one pass a parameter to a parameterized query, such as: SELECT * FROM MyTable WHERE ? Thanks, Roger Roger Montague Waconia, Minnesota USA -- Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Calling Parameterized Queries
Hello Norbert, Thank you for your response! So, Firebird SQL does accept named parameters. That is good to know. Thanks Again, Roger From: Norbert Saint Georges [mailto:norbert.saint-geor...@sixsigmagreen.eu] Sent: Saturday, December 10, 2011 12:08 PM To: Firebird-net-provider@lists.sourceforge.net Subject: Re: [Firebird-net-provider] Calling Parameterized Queries Hi Roger, In C#, I code it like this. StringBuilder sqlCommand = new StringBuilder(); sqlCommand.Append(" SELECT * FROM MyTable WHERE ); sqlCommand.Append("Guid = @Guid "); sqlCommand.Append("OR Guid = UPPER(@Guid) "); sqlCommand.Append(";"); FbParameter[] arParams = new FbParameter[1]; arParams[0] = new FbParameter("@Guid", FbDbType.Char, 36); arParams[0].Direction = ParameterDirection.Input; arParams[0].Value = guid.ToString(); Norbert Saint Georges Six Sigma Business Intelligence Analyst Six Sigma Green Rue de la Reine 5 B- 1330 Rixensart Tel. +32 (0)28808810 www.sixsigmagreen.eu De : Roger Montague [mailto:rogermonta...@embarqmail.com] Envoyé : samedi 10 décembre 2011 17:08 À : Firebird-net-provider@lists.sourceforge.net Objet : [Firebird-net-provider] Calling Parameterized Queries Hi Listers, This is a pretty basic question, but I havent found the answer to it yet. In C#, how would one pass a parameter to a parameterized query, such as: SELECT * FROM MyTable WHERE ? Thanks, Roger Roger Montague Waconia, Minnesota USA -- Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] Calling Parameterized Queries
At 07:43 AM 11/12/2011, Roger Montague wrote: >Content-Type: multipart/alternative; >boundary="=_NextPart_000_00BA_01CCB739.56AABA30" >Content-Language: en-us > >Hello Norbert, > >Thank you for your response! > >So, Firebird SQL does accept named parameters. That is good to know. > No, it doesn't. But many drivers - including this one - take charge of the parameters and wrap local named structures around the order-dependent elements of the API structure to simplify life for the programmer. Helen p.s., For the first time, in Fb 2.5, Firebird "kind of" provides named parameters, inside the PSQL language, within the extended EXECUTE STATEMENT construct. It's not mimicked in DSQL, though. -- Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider