Home All Groups Group Topic Archive Search About

Connection String how to...

Author
12 Dec 2005 8:58 AM
Jacek Jurkowski
<configuration>
  <connectionStrings>
    <add name="Northwind"
         connectionString="Data Source=localhost;Integrated
Security=SSPI;Initial Catalog=Northwind;"
         providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>How to access "Northwind" from the c# code?I supposed to
write String s =
ConfigurationSettings.ConnectionStrings["Northwind"].ConnectionStringbut it
causes an error that ConnectionStrings section is not found.What do I do
wrong?

Author
12 Dec 2005 10:07 AM
Royhwa via DotNetMonster.com
<add key="Northwind" value="server=127.0.0.1;User
id=sa;Password=23131;database=Northwind;"/>

string s = ConfigurationSettings.AppSettings["ConnectionString"])


Jacek Jurkowski wrote:
Show quoteHide quote
><configuration>
>  <connectionStrings>
>    <add name="Northwind"
>         connectionString="Data Source=localhost;Integrated
>Security=SSPI;Initial Catalog=Northwind;"
>         providerName="System.Data.SqlClient" />
>  </connectionStrings>
></configuration>How to access "Northwind" from the c# code?I supposed to
>write String s =
>ConfigurationSettings.ConnectionStrings["Northwind"].ConnectionStringbut it
>causes an error that ConnectionStrings section is not found.What do I do
>wrong?

--
Message posted via http://www.dotnetmonster.com
Are all your drivers up to date? click for free checkup

Author
12 Dec 2005 10:07 AM
Royhwa via DotNetMonster.com
<add key="Northwind" value="server=127.0.0.1;User
id=sa;Password=23131;database=Northwind;"/>

string s = ConfigurationSettings.AppSettings["Northwind"])


Jacek Jurkowski wrote:
Show quoteHide quote
><configuration>
>  <connectionStrings>
>    <add name="Northwind"
>         connectionString="Data Source=localhost;Integrated
>Security=SSPI;Initial Catalog=Northwind;"
>         providerName="System.Data.SqlClient" />
>  </connectionStrings>
></configuration>How to access "Northwind" from the c# code?I supposed to
>write String s =
>ConfigurationSettings.ConnectionStrings["Northwind"].ConnectionStringbut it
>causes an error that ConnectionStrings section is not found.What do I do
>wrong?

--
Message posted via http://www.dotnetmonster.com
Author
12 Dec 2005 10:57 AM
Patrick.O.Ige
Pan Jacek mysle ze pan juz wie jak to robi
Patrick
* Jak nie to prosze zapytac

Show quoteHide quote
"Jacek Jurkowski" <pcmi***@priv1.onet.pl> wrote in message
news:uRyt6ov$FHA.3864@TK2MSFTNGP12.phx.gbl...
> <configuration>
>   <connectionStrings>
>     <add name="Northwind"
>          connectionString="Data Source=localhost;Integrated
> Security=SSPI;Initial Catalog=Northwind;"
>          providerName="System.Data.SqlClient" />
>   </connectionStrings>
> </configuration>How to access "Northwind" from the c# code?I supposed to
> write String s =
> ConfigurationSettings.ConnectionStrings["Northwind"].ConnectionStringbut
it
> causes an error that ConnectionStrings section is not found.What do I do
> wrong?
>
>

Bookmark and Share