Ability to programatically set the Application Active Connection String


Author
Message
Peter Denton
Peter Denton
StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)StrataFrame Novice (97 reputation)
Group: Forum Members
Posts: 77, Visits: 787
G'day

We have a suite of programs that will run on a single dedicated server via numerous terminal server sessions, with every program in every session for every user accessing the same database which is usually on a second dedicated server. When the second server fails (which it will), we need to be able to be able to have the user quickly swap the connection to the database on the Application server (which is transactionally replicated from the database server). The users we deal with are shop floor supervisors in a very low tech industry (Leather Tanning), and this is a task that we may have to direct them to do after having been woken up at 4am in the morning by a phone call from the other side of the country, and that has to be done quickly because production will have stopped with potentially 50 workers standing around waiting, so simplicity is essential. I want to provide a form with a single button, that upon pressing the button will swap the connection for them and confirm that it has been done (with appropriate safeguards to ensure it isn't done accidently, i.e. limit the access to a single user specific to the task e.g. user id "Swap").

ConnectionManager.ShowAvailableConnectionStrings() is a convenient way of maintaining the connection strings, and the "Select" capability does what we want, except for the fact that the user performing the task could have the wrong connection selected at the time (our users are not renowned for their clarity at describing what is on the screen in front of them at such times, or any other times for that matter). We would use it for configuring the system while on-site installing. And switching servers is an installation test we always perform, to ensure that we have the settings right.

What I would find useful would be

public function SetApplicationActiveConnectionString(ByVal ApplicationKey as String, _
                                                                        ByVal DataSourceKey As String, _
                                                                        ByVal ApplicationDefaultTitle As String) _
                                                                        As Boolean

which would do just as pressing the "Select"  in ShowAvailableConnectionStrings does returning true if sucessful false otherwise (i.e. there is no connection string for the given combination).

Any chance of something like this?

I have investigated storing Connection Strings in each App's .config, but then I have a problem with ensuring that they are all kept in sync, and I don't really want to reinvent the wheel.

Peter


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search