Newbie question

G

Guest

WEB.CONFIG file is the best place to store connection
settings

In <appSettings> section, you may add some thing like
following sample
<add key="CONNSTR1" value="Data Source=DB1;User
ID=user1;Password=pass1;" />
<add key="CONNSTR2" value="Data Source=DB2;User
ID=user2;Password=pass2;" />

in the C# code, use to retrieve this info
string conStr = ConfigurationSettings.AppSettings
['CONNSTR1'];

Good luck
Sree
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top