We have the same database on multiple servers. How can I programmatically via a web app change connection on the fly to a different server. All databases have the same name and schema.
1 Answer, 1 is accepted
answered on 01 Dec 2010, 01:16 PM
You can use the constructor of the OpenAccessContext class which takes a connection parameter and pass a connection string or connection string name (if the connection string is itself present in the .config file). To switch to another server it is enough just to create a new context instance with the appropriate connection string. Here is an example: