Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading Enterprise Library settings
Message
De
23/03/2007 15:56:02
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
23/03/2007 15:14:30
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
01207770
Message ID:
01207971
Vues:
22
Haven't done it that way, but it looks good. Appears to be the same as VFP with 10 ways to do the same thing.



>>System.Configuration.AppSettingsReader, i.e.:
>>
>>           System.Configuration.AppSettingsReader asr = new System.Configuration.AppSettingsReader();
>>           string currentTargetServerName = asr.GetValue("SQLServerName", typeof(System.String)).ToString();
>>           string currentTargetDatabaseName = asr.GetValue("SQLDatabaseName", typeof(System.String)).ToString();
>>
>>
>>
>>>All,
>>>
>>> I have an application that uses enterprise library to connect to a database. I need to know how to read a connection string from the app.config file. How do I do it? What namespaces do I need?
>
>Do you really need a reader?
>
>
using System.Configuration;
>string SQLServerName = ConfigurationManager.AppSettings["SQLServerName"].ToString();
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform