Does ADO.NET unified the way to use parameters in sql query string?
No matter what database server or driver are being used, can ADO.NET layer
supports so called named or unnamed parameters? And defines fixed parameter
marker character? Does ANSI SQL define rules for parameter marker?
That way, maybe easier to develop application works with most database
server.
Thanks,
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
Ryan Liu
Shanghai Fengpu Software Co. Ltd
Shanghai , China
http://www.PowerCATI.com Powerful CATI!
http://www.fpsoft.net.cn
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
Marc Gravell - 12 Jan 2008 20:34 GMT
I suspect it is down to the specific provider to care about the
structure. For instance, IIRC, the SqlClient provider *only* supports
named parameters (not 100% sure, but just seem to recall...)
Marc
Arne Vajhøj - 12 Jan 2008 21:28 GMT
> Does ADO.NET unified the way to use parameters in sql query string?
>
> No matter what database server or driver are being used, can ADO.NET
> layer supports so called named or unnamed parameters? And defines fixed
> parameter marker character? Does ANSI SQL define rules for parameter
> marker?
4 x No
You will have to parameterize that yourself (it is not that difficult).
Arne
Nicholas Paldino [.NET/C# MVP] - 12 Jan 2008 21:35 GMT
Un addition to the other answers, you might want to look at the data
access enterprise block. The Database class has a property on it that
indicates what the parameter marker is for a particular database provider.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Does ADO.NET unified the way to use parameters in sql query string?
>
[quoted text clipped - 17 lines]
> http://www.fpsoft.net.cn
> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.