コード例 #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);
        }
コード例 #2
0
 public void Process(RegisterConnectionProvidersPipelineArgs args)
 {
     args.ConnectionProviders.Add("sql", new SQLProvider());
 }
コード例 #3
0
 public void Process(RegisterConnectionProvidersPipelineArgs args)
 {
     args.ConnectionProviders.Add("oledb", new OleDbProvider());
 }
コード例 #4
0
 public void Process(RegisterConnectionProvidersPipelineArgs args)
 {
     args.ConnectionProviders.Add("odbc", new OdbcProvider());
 }