D
dbuchanan
Here is part of the web.config - it is given to me like this.
=======================
<configuration>
<appSettings/>
<connectionStrings>
<add name="MyConnectionName" connectionString="Data
Source=MyServerName;Initial Catalog=MyDatabaseName;Integrated Security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
=======================
How do I get the connection string?
The follwoing code is my attempt to connect
string cnStr;
cnStr = ConfigurationSettings. << At this point intellisense gives me the
following:
AppSettings
Equals
GetConfig
ReferencEquals
Introducing Microsoft ASP.NET 2.0 Shows a different suggests the following
code
cnStr =
ConfigurationSettings.connecionStrings["MyConnectionName"].ConnectionString;
However I get the following error
Error 1 'System.Configuration.ConfigurationSettings' does not contain a
definition for 'connecionStrings' C:\Documents and Settings\Administrator\My
Documents\Visual Studio 2005\WebSites\WebSiteCompletionReport\Default.aspx
13 41 C:\...\WebSiteCompletionReport\
=======================
<configuration>
<appSettings/>
<connectionStrings>
<add name="MyConnectionName" connectionString="Data
Source=MyServerName;Initial Catalog=MyDatabaseName;Integrated Security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
=======================
How do I get the connection string?
The follwoing code is my attempt to connect
string cnStr;
cnStr = ConfigurationSettings. << At this point intellisense gives me the
following:
AppSettings
Equals
GetConfig
ReferencEquals
Introducing Microsoft ASP.NET 2.0 Shows a different suggests the following
code
cnStr =
ConfigurationSettings.connecionStrings["MyConnectionName"].ConnectionString;
However I get the following error
Error 1 'System.Configuration.ConfigurationSettings' does not contain a
definition for 'connecionStrings' C:\Documents and Settings\Administrator\My
Documents\Visual Studio 2005\WebSites\WebSiteCompletionReport\Default.aspx
13 41 C:\...\WebSiteCompletionReport\