예제 #1
0
        public DataProvider()
        {
            // Read the configuration specific information for this provider
            Framework.Providers.Provider objProvider = (Framework.Providers.Provider)_providerConfiguration.Providers[_providerConfiguration.DefaultProvider];

            // This code handles getting the connection string from either the connectionString / appsetting section and uses the connectionstring section by default if it exists.
            // Get Connection string from web.config
            _connectionString = DotNetNuke.Common.Utilities.Config.GetConnectionString();

            // If above funtion does not return anything then connectionString must be set in the dataprovider section.
            if (_connectionString == string.Empty)
            {
                // Use connection string specified in provider
                _connectionString = objProvider.Attributes["connectionString"];
            }

            _providerPath = objProvider.Attributes["providerPath"];

            _objectQualifier = objProvider.Attributes["objectQualifier"];
            if (_objectQualifier != string.Empty & _objectQualifier.EndsWith("_") == false)
            {
                _objectQualifier += "_";
            }

            _databaseOwner = objProvider.Attributes["databaseOwner"];
            if (_databaseOwner != string.Empty & _databaseOwner.EndsWith(".") == false)
            {
                _databaseOwner += ".";
            }

            _fullModuleQualifier = _databaseOwner + _objectQualifier + _moduleDataPrefix;
        }
예제 #2
0
        public SqlDataProvider()
        {
            // Read the configuration specific information for this provider
            Framework.Providers.Provider objProvider = (Framework.Providers.Provider)(p_providerConfiguration.Providers[p_providerConfiguration.DefaultProvider]);

            // Read the attributes for this provider
            if (!(string.IsNullOrEmpty(objProvider.Attributes[c_ConnectionStringName])))
            {
                p_connectionString = DotNetNuke.Common.Utilities.Config.GetConnectionString();
            }
            else
            {
                p_connectionString = objProvider.Attributes[c_ConnectionString];
            }

            p_providerPath = objProvider.Attributes["providerPath"];

            p_objectQualifier = objProvider.Attributes["objectQualifier"];
            if (!(string.IsNullOrEmpty(p_objectQualifier)) && p_objectQualifier.EndsWith("_") == false)
            {
                p_objectQualifier = string.Concat(p_objectQualifier, "_");
            }

            p_databaseOwner = objProvider.Attributes["databaseOwner"];
            if (!(string.IsNullOrEmpty(p_databaseOwner)) && p_databaseOwner.EndsWith(".") == false)
            {
                p_databaseOwner = string.Concat(p_databaseOwner, ".");
            }
        }
예제 #3
0
        public SqlDataProvider()
        {
            // Read the configuration specific information for this provider
            Framework.Providers.Provider objProvider = (Framework.Providers.Provider)_providerConfiguration.Providers[_providerConfiguration.DefaultProvider];

            // Read the attributes for this provider
            //If objProvider.Attributes("connectionStringName") <> "" AndAlso _
            //System.Configuration.ConfigurationSettings.AppSettings(objProvider.Attributes("connectionStringName")) <> "" Then
            //    _connectionString = System.Configuration.ConfigurationSettings.AppSettings(objProvider.Attributes("connectionStringName"))
            //Else
            //    _connectionString = objProvider.Attributes("connectionString")
            //End If

            _connectionString = Config.GetConnectionString();

            _providerPath = objProvider.Attributes["providerPath"];

            _objectQualifier = objProvider.Attributes["objectQualifier"];
            if (!string.IsNullOrEmpty(_objectQualifier) & _objectQualifier.EndsWith("_") == false)
            {
                _objectQualifier += "_";
            }

            _databaseOwner = objProvider.Attributes["databaseOwner"];
            if (!string.IsNullOrEmpty(_databaseOwner) & _databaseOwner.EndsWith(".") == false)
            {
                _databaseOwner += ".";
            }
        }