Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

ADO.NET: named parameter or unnamed, use ? or @, even  % [ ]

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ryan Liu - 12 Jan 2008 13:43 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?

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
> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.