Пример #1
0
 /// <summary>
 /// Get database connection.
 /// </summary>
 public static string GetConnectionString(string serverName, string databaseName)
 {
     if (_UseWindowsAuthentication)
     {
         return(ConnectionManagerBase.GetWinAuthConnectionString(serverName, databaseName));
     }
     else
     {
         return(ConnectionManagerBase.GetGenericConnectionString(serverName, databaseName));
     }
 }
Пример #2
0
        public static string GetEnvironmentMasterConnectionString()
        {
            string    ConnString = "";
            DataTable dt         = ConnectionManagerBase.ServerTable;

            DataRow[] Rows = dt.Select("ServerTypeCode = '" + CRMConfig.EnvironmentMode + "' AND IsEnvironmentMaster = 1");
            if (Rows.Length == 1)
            {
                ConnString = ConnectionManagerBase.GetGenericConnectionString(Rows[0]["ServerName"].ToString(), EnterpriseDatabaseName);
            }
            return(ConnString);
        }