Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to modify connection string at runtime
Message
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01212660
Message ID:
01212675
Views:
14
Mike,

Thanks for your quick feedback.

1. No sooner did I click send to my posting than it dawned on me that I can set the connection string for the adapters directly:

this.patientsTableAdapter.Connection.ConnectionString =

I'm experimenting with this now. I am getting an error saying the ConnectionString has not been initialzied.

2. I thought initially about changing the value of ConnectionStringWoundDB in the application config file, but it isn't clear to me when and how that file is used. As far as I can tell from the designer created code, Properties.Settings.Default.ConnectionStringWoundDB is hard-coded into the application.

Here is the designer generated code in Settings.Designer.cs:
 [global::System.Configuration.DefaultSettingValueAttribute("Provider=VFPOLEDB.1;Data Source=\"D:\\Program Development\\wounddb\\DATA\\wounddb.dbc\"" +
            ";Collating Sequence=MACHINE")]
 public string ConnectionStringWoundDB {
   get {
       return ((string)(this["ConnectionStringWoundDB"]));
   }
 }
What do you think?

Thanks,
Jim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform