Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change Server Name In Conn String
Message
De
23/02/2010 14:37:22
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01450537
Message ID:
01450565
Vues:
45
>I want to store the SQL server name for my DataAccess class. Where's the best place to store this?

In a property of the DataAccess class that if not already populated retrieves it from a configuration file. I would presume you would want to be able to change that as needed without recompiling.
Tim
///
/// Database Server Name Property
///
public string DatabaseServerName
{
     get
     {
          if (databaseServerName == string.Empty)
              databaseServerName = Settings.Instance.DatabaseServerName;
         return databaseServerName;
}
private string databaseServerName = string .Empty;
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform