Information générale
Titre:
How to modify connection string at runtime
Versions des environnements
Network:
Windows 2003 Server
I've been using VS2005 and its designers to set up a DataGridView. The DataGridView is being filled by a TableAdapter. The TableAdapter uses a connection object whose connection string is set from
global::GetDatabaseIDsDlg.Properties.Settings.Default.ConnectionStringWoundDB;
This was all set up by the VS2005 designer. This works fine for developing the application. However, I want to be able to change the connection string at runtime. But, I have found that the designer creates Properties.Settings.Default.ConnectionStringWoundDB as ReadOnly. So, I can't change that at runtime.
Surely, there must be some simple way to change the ConnectionString that my TableAdapters are using at runtime. But I haven't been able to figure it out yet. (Still new at .NET development)
Kind of a corrollary: The designers are just implementing in code what I set up on properties pages, etc. But, I can't see where ConnectionStringWoundDB is made read-only.
Thanks for the help.
Jim
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement