Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions pageOpens in a new window (login required).

Loading Configuration Information

To load the connection information into your program, use the Get method of the ConfigurationManager.AppSettings class. Use the values to build the connection string. Here is the InitConnection method from PhonebookObj:


private void InitConnection()
{
  //Retrieve connection information from the configuration file.
  string server = ConfigurationManager.AppSettings.Get("server");
  string logfile = ConfigurationManager.AppSettings.Get("logfile");
  string port = ConfigurationManager.AppSettings.Get("port");
  string nspace = ConfigurationManager.AppSettings.Get("namespace");
  string user = ConfigurationManager.AppSettings.Get("user");
  string pwd = ConfigurationManager.AppSettings.Get("pwd");
  string cacheConnectStr = "Server = " + server + "; Log File = " + logfile + 
      ";Port = " + port + "; Namespace = " + nspace + "; Password = " + pwd + 
      "; User ID = " + user; 
  
  cnCache = new CacheConnection(cacheConnectStr);
  cnCache.Open();
 }
Copy code to clipboard
FeedbackOpens in a new window