Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to modify connection string at runtime
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01212660
Message ID:
01212675
Vues:
13
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform