Example #1
0
 public static Connection CreateConnection(AstConnectionNode astNode)
 {
     switch (astNode.ConnectionType)
     {
         case ConnectionType.OleDB: return new OleDBConnection(astNode);
         case ConnectionType.AdoNet: return new AdoNetConnection(astNode);
         case ConnectionType.File: return new FileConnection(astNode.Name, astNode.OleConnectionString);
         default:
             throw new NotSupportedException(String.Format(CultureInfo.InvariantCulture, Properties.Resources.ErrorEnumerationTypeNotSupported, astNode.ConnectionType));
     }
 }
Example #2
0
        protected Connection(AstConnectionNode astNode) : base(astNode.Name) 
        {
            switch (astNode.ConnectionType)
            {
                case VulcanEngine.IR.Ast.Connection.ConnectionType.File:
                    ConnectionType = "{8527E0C4-1D7E-46B5-AC99-4AD36D172CB3}";
                    break;
                case VulcanEngine.IR.Ast.Connection.ConnectionType.OleDB:
                    ConnectionType = "{3BA51769-6C3C-46B2-85A1-81E58DB7DAE1}";
                    break;
                case VulcanEngine.IR.Ast.Connection.ConnectionType.AdoNet:
                    ConnectionType = "AdoNet";
                    break;
            }

            ConnectionString = astNode.OleConnectionString;
            OriginalConnectionString = astNode.OleConnectionString;
            RetainSameConnection = astNode.RetainSameConnection;
        }