Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connection strings
Message
From
11/01/2011 10:59:56
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01495597
Message ID:
01495660
Views:
37
>>Thanks
>>
>>and my supplementary question is why ?
>
>One of the main reasons would be consistency. Developers will expect connectionstrings to be kept there.
>
>Also, Configurationmanager.Connectionstring('connectionstringname') will return a connectionstring properly.

It's a shame that Visual Studio doesn't generate a class from the web.config so these type of things couldn't be strongly typed, similar to how the resource files work.


>>Nick
>>
>>
>>>connectionStrings
>>>
>>>>I'm looking at 2 web sites
>>>>
>>>>one has connection strings stored in
>>>>
>>>>
>>>><appSettings>    
>>>>    <add key="SQLConn" value="Data Source=TEST\SQLEXPRESS;Initial Catalog=Validation;Connection Timeout=300;User ID=webuser;Password=password" />
>>>>
>>>>the other has
>>>>
>>>>
   <connectionStrings>
>>>>    <add name="SQL" connectionString="Data Source=TEST\SQLEXPRESS;Initial Catalog=Validation;Connection Timeout=300;User ID=webuser;Password=password" providerName="System.Data.SqlClient"/>
>>>>
>>>>
>>>>Whats the best method ?
>>>>
>>>>Thanks
>>>>
>>>>Nick
Very fitting: http://xkcd.com/386/
Previous
Reply
Map
View

Click here to load this message in the networking platform