General information
Title:
How to modify connection string at runtime
Environment versions
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only