Here is part of the web.config - it is given to me like this.
=============== ========
<configuratio n>
<appSettings/>
<connectionStri ngs>
<add name="MyConnect ionName" connectionStrin g="Data
Source=MyServer Name;Initial Catalog=MyDatab aseName;Integra ted Security=True"
providerName="S ystem.Data.SqlC lient"/>
</connectionStrin gs>
<system.web>
=============== ========
How do I get the connection string?
The follwoing code is my attempt to connect
string cnStr;
cnStr = ConfigurationSe ttings. << 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 =
ConfigurationSe ttings.connecio nStrings["MyConnectionNa me"].ConnectionStri ng;
However I get the following error
Error 1 'System.Configu ration.Configur ationSettings' does not contain a
definition for 'connecionStrin gs' C:\Documents and Settings\Admini strator\My
Documents\Visua l Studio 2005\WebSites\W ebSiteCompletio nReport\Default .aspx
13 41 C:\...\WebSiteC ompletionReport \
=============== ========
<configuratio n>
<appSettings/>
<connectionStri ngs>
<add name="MyConnect ionName" connectionStrin g="Data
Source=MyServer Name;Initial Catalog=MyDatab aseName;Integra ted Security=True"
providerName="S ystem.Data.SqlC lient"/>
</connectionStrin gs>
<system.web>
=============== ========
How do I get the connection string?
The follwoing code is my attempt to connect
string cnStr;
cnStr = ConfigurationSe ttings. << 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 =
ConfigurationSe ttings.connecio nStrings["MyConnectionNa me"].ConnectionStri ng;
However I get the following error
Error 1 'System.Configu ration.Configur ationSettings' does not contain a
definition for 'connecionStrin gs' C:\Documents and Settings\Admini strator\My
Documents\Visua l Studio 2005\WebSites\W ebSiteCompletio nReport\Default .aspx
13 41 C:\...\WebSiteC ompletionReport \
Comment