Dotnet-StuffWorld

Wednesday, September 9, 2009

 

Formating Rules for Connection Strings

 The rules:

* All blank characters, except those placed within a value or within quotation marks, are ignored

* Blank characters will though affect connection pooling mechanism, pooled connections must have the EXACT same connection string

* If a semicolon (;) is part of a value it must be delimited by quotation marks (")

* Use a single-quote (') if the value begins with a double-quote (")

* Conversely, use the double quote (") if the value begins with a single quote (')

* No escape sequences are supported

* The value type is NOT relevant

* Names are case iNsEnSiTiVe

* If a KEYWORD=VALUE pair occurs more than once in the connection string, the value associated with the LAST occurrence is used

* But!... if the PROVIDER keyword occurs multiple times in the string, the FIRST occurrence is used.

* If a keyword contains an equal sign (=), it must be preceded by an additional equal sign to indicate that it is part of the keyword.


Summary:
Knowing about these basic rules will keep hard to track errors away from you. Take some time understanding these rules and a couple of minutes choosing what parameters to specify when connecting your application to the data source.
..

Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

Archives

April 2009   July 2009   August 2009   September 2009   September 2010   February 2011  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]