Exemplo n.º 1
0
        public static IDbConnection GetConnection(string type, string connectionString)
        {
            IDbConnection conn = null;

            var args = new RegisterConnectionProvidersPipelineArgs();

            //Get all the available providers. Done this way so Oracle Provider can be added by other teams.
            Sitecore.Pipelines.CorePipeline.Run("registerConnectionProviders", args);

            if (args.ConnectionProviders.ContainsKey(type.ToLower()))
            {
                var provider = args.ConnectionProviders[type.ToLower()];
                conn = provider.GetConnection(connectionString);
            }

            return(conn);
        }
Exemplo n.º 2
0
 public void Process(RegisterConnectionProvidersPipelineArgs args)
 {
     args.ConnectionProviders.Add("sql", new SQLProvider());
 }
 public void Process(RegisterConnectionProvidersPipelineArgs args)
 {
     args.ConnectionProviders.Add("oledb", new OleDbProvider());
 }
 public void Process(RegisterConnectionProvidersPipelineArgs args)
 {
     args.ConnectionProviders.Add("odbc", new OdbcProvider());
 }