Example #1
0
        public static void Add(
            string name,
            string connectionString,
            string providerName)
        {
            Configure();
            if (name.IsNullOrEmpty())
            {
                throw new ArgumentException(
                          "connectionString's name can't be null",
                          "name"
                          );
            }
            if (connectionString.IsNullOrEmpty())
            {
                throw new ArgumentException(
                          "connectionString's connectionString can't be null",
                          "connectionString"
                          );
            }
            if (providerName.IsNullOrEmpty())
            {
                throw new ArgumentException(
                          "connectionString's providerName can't be null",
                          "providerName"
                          );
            }

            name = name.ToUpper();

            lock (_Lock) {
                var settings = new DataProviderSetting()
                {
                    Name             = name,
                    ConnectionString = connectionString,
                    ProviderName     = providerName,
                };
                Add(settings);
            }
        }
Example #2
0
        public static void Add(
			string name,
			string connectionString,
			string providerName)
        {
            Configure();
            if(name.IsNullOrEmpty()) {
                throw new ArgumentException(
                    "connectionString's name can't be null",
                    "name"
                );
            }
            if(connectionString.IsNullOrEmpty()) {
                throw new ArgumentException(
                    "connectionString's connectionString can't be null",
                    "connectionString"
                );
            }
            if(providerName.IsNullOrEmpty()) {
                throw new ArgumentException(
                    "connectionString's providerName can't be null",
                    "providerName"
                );
            }

            name = name.ToUpper();

            lock(_Lock) {
                var settings = new DataProviderSetting() {
                    Name = name,
                    ConnectionString = connectionString,
                    ProviderName = providerName,
                };
                Add(settings);
            }
        }