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:
use "control database" houses connection strings , configurations. if migrate new database server, have update single connection string in application, , perform data updates else. use.
use central xml configuration file parsed on application startup.
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
Post a Comment