Connection String how to...

J

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?
 
R

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 said:
<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?
 
R

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 said:
<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?
 
P

Patrick.O.Ige

Pan Jacek mysle ze pan juz wie jak to robi
Patrick
* Jak nie to prosze zapytac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top