0

In web.config we store connection string like:

 connectionString="Server=serverName;Database=dbName;Username=xyz;Password=xyz"

But everytime, server name keeps on changing...i mean many times Database is shifted from one server to another. So all the time we need to change connection string in all apllications

Is is possible to store server name in machine.config file and other part of connection string i.e. Database name, username, password in web.config file?

If possible How?... Can we add something like "key"?

user1181942
  • 1,587
  • 7
  • 35
  • 45

1 Answers1

0

You could store the connection string directly in the machine.config

Here's a thread discussing that option: Storing connection strings in machine.config vs storing them in web.config

Community
  • 1
  • 1
Vimal Stan
  • 2,007
  • 1
  • 12
  • 14
  • I dont want to store complete connection string in Machine.config file...it just databse server name the I want to store – user1181942 Mar 14 '13 at 05:54