public static DataAccessProvider CreateDataAccess(DataAccessProviderConfiguration objConfig)
 {
     if (objProvider != null) return objProvider;
     Type type = Type.GetType(((Provider) objConfig.Providers[objConfig.DefaultProvider]).ProviderType);
     objProvider = (DataAccessProvider)Activator.CreateInstance(type, AppEnv.GetConnectionString(((Provider)objConfig.Providers[objConfig.DefaultProvider]).ConnectionString));
     return objProvider;
 }
Пример #2
0
        public object Create(object parent, object context, XmlNode node)
        {
            DataAccessProviderConfiguration objConfig = new DataAccessProviderConfiguration();

            objConfig.LoadValuesFromConfigurationXml(node);
            return(objConfig);
        }
Пример #3
0
        public static DataAccessProvider Instance()
        {
            if (objProvider != null)
            {
                return(objProvider);
            }
            DataAccessProviderConfiguration objConfig = DataAccessProviderConfiguration.GetDataAccessProviderConfiguration();

            objProvider = (DataAccessProvider)DataAccessProviderFactory.CreateDataAccess((Provider)objConfig.Providers[objConfig.DefaultProvider]);
            return(objProvider);
        }
Пример #4
0
        public static DataAccessProvider CreateDataAccess(DataAccessProviderConfiguration objConfig)
        {
            if (objProvider != null)
            {
                return(objProvider);
            }
            Type type = Type.GetType(((Provider)objConfig.Providers[objConfig.DefaultProvider]).ProviderType);

            objProvider = (DataAccessProvider)Activator.CreateInstance(type, AppEnv.GetConnectionString(((Provider)objConfig.Providers[objConfig.DefaultProvider]).ConnectionString));
            return(objProvider);
        }
Пример #5
0
        public static DataAccessProvider CreateDataAccess()
        {
            DataAccessProviderConfiguration objConfig = DataAccessProviderConfiguration.GetDataAccessProviderConfiguration();

            return(CreateDataAccess(objConfig));
        }