Esempio n. 1
0
        public string GetConnectionString(string connection_name)
        {
            if (string.IsNullOrEmpty(connection_name))
            {
                throw new ArgumentException("Missing Connection Name");
            }

            DatabaseConnectionElement dc_elm = EnvironmentConfig.DataEnvironment[ConfigurationManager.AppSettings["DataEnvironment"]].DatabaseConnection[connection_name];

            return(dc_elm.ConnectionString);
        }
Esempio n. 2
0
        public string GetConnectionString(string connection_name, Func <string, string, string> get_pswd)
        {
            if (string.IsNullOrEmpty(connection_name))
            {
                throw new ArgumentException("Missing Connection Name");
            }

            DatabaseConnectionElement dc_elm = EnvironmentConfig.DataEnvironment[ConfigurationManager.AppSettings["DataEnvironment"]].DatabaseConnection[connection_name];

            if (!string.IsNullOrEmpty(dc_elm.TisamUid))
            {
                return(string.Format(dc_elm.ConnectionString, get_pswd(dc_elm.TisamUid, dc_elm.TKey)));
            }
            return(dc_elm.ConnectionString);
        }