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;
 }
Exemplo n.º 2
0
        public object Create(object parent, object context, XmlNode node)
        {
            DataAccessProviderConfiguration objConfig = new DataAccessProviderConfiguration();

            objConfig.LoadValuesFromConfigurationXml(node);
            return(objConfig);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
        public static DataAccessProvider CreateDataAccess()
        {
            DataAccessProviderConfiguration objConfig = DataAccessProviderConfiguration.GetDataAccessProviderConfiguration();

            return(CreateDataAccess(objConfig));
        }