c# connection string change due to database move -


we moving database 1 server another. there many connection strings of applications needs changed due this. there generic way can keep connection string if move database again issue doesn't arise??

there many ways resolve problem.

ultimately sounds want centralize database connection strings in such way database migration (mostly) transparent application. can think of few options here:

  1. use "control database" houses connection strings , configurations. if migrate new database server, have update single connection string in application, , perform data updates else. use.

  2. use central xml configuration file parsed on application startup.

  3. use sql server aliases and/or add additional ips machine can migrate between servers. way when move new database server can still bring along existing aliases/ips server (unless need run in parallel of course) , theoretically not need update in code, provided you've referenced appropriate aliases. see here more info: https://dba.stackexchange.com/questions/56642/how-to-create-a-server-alias-in-sql-server-2012

over here went option 1 because gave more flexibility , reliability xml configuration file (#2) , required less configuration , special cases documented our dbas, since have no ownership of database servers outside of our dev environment.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -