Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change Server Name In Conn String
Message
From
23/02/2010 14:37:22
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01450537
Message ID:
01450565
Views:
44
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform