Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connection string in web.config
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00823105
Message ID:
00823119
Vues:
21
Web.Config is the recommended place for the connection string to be. Though, I would create a wrapper class and create a method in it that reads and returns ConnectionString from ConfigurationSettings.AppSettings.

>I am not using Mere Mortals.NET (yet!), but I am using the business object in the Hentzenwerke book. Right now, I have the database connection string hard-coded in the BusinessObject base class. Is it a better idea to put this in the web.config file? That seems to be what I am reading so far as best practices. If so, then should I set the connection string from web.config in the BusinessObject constructor method?
>
>
>public BusinessObject()
>{
>   this.strConnectionString = ConfigurationSettings.AppSettings("constring");
>}
>
- Jayesh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform