示例#1
0
        public static OLEDBCommand CreateOLEDBCommandFromXml(Packages.VulcanPackage vulcanPackage, IDTSComponentMetaData90 parentComponent, MainPipe dataFlowTask, XPathNavigator commandNav)
        {
            if (commandNav == null || commandNav.Name.ToUpperInvariant() != "OLEDBCommand".ToUpperInvariant())
            {
                return(null);
            }

            string commandName = commandNav.SelectSingleNode("@Name", vulcanPackage.VulcanConfig.NamespaceManager).Value;

            Message.Trace(Severity.Debug, "Begin: OLEDB Transformation {0}", commandName);
            Connection destConnection =
                Connection.GetExistingConnection(
                    vulcanPackage,
                    commandNav.SelectSingleNode("rc:DestinationConnection/@Name", vulcanPackage.VulcanConfig.NamespaceManager).Value
                    );

            string command = commandNav.SelectSingleNode("rc:Command", vulcanPackage.VulcanConfig.NamespaceManager).Value;

            OLEDBCommand dbc = new OLEDBCommand(vulcanPackage, dataFlowTask, parentComponent, commandName, commandName, destConnection, command);

            foreach (XPathNavigator nav in commandNav.Select("rc:Map", vulcanPackage.VulcanConfig.NamespaceManager))
            {
                string source      = nav.SelectSingleNode("@Source").Value;
                string destination = nav.SelectSingleNode("@Destination") == null
                                     ? "@" + source
                                     : nav.SelectSingleNode("@Destination").Value;
                dbc.Map(source, destination, false);
            }
            return(dbc);
        }
示例#2
0
        public static OLEDBCommand CreateOLEDBCommandFromXml(Packages.VulcanPackage vulcanPackage, IDTSComponentMetaData90 parentComponent, MainPipe dataFlowTask, XPathNavigator commandNav)
        {
            if (commandNav == null || commandNav.Name.ToUpperInvariant() != "OLEDBCommand".ToUpperInvariant())
            {
                return null;
            }

            string commandName = commandNav.SelectSingleNode("@Name", vulcanPackage.VulcanConfig.NamespaceManager).Value;

            Message.Trace(Severity.Debug, "Begin: OLEDB Transformation {0}", commandName);
            Connection destConnection =
                Connection.GetExistingConnection(
                                                vulcanPackage,
                                                commandNav.SelectSingleNode("rc:DestinationConnection/@Name", vulcanPackage.VulcanConfig.NamespaceManager).Value
                                                );

            string command = commandNav.SelectSingleNode("rc:Command", vulcanPackage.VulcanConfig.NamespaceManager).Value;

            OLEDBCommand dbc = new OLEDBCommand(vulcanPackage, dataFlowTask, parentComponent, commandName, commandName, destConnection, command);

            foreach (XPathNavigator nav in commandNav.Select("rc:Map", vulcanPackage.VulcanConfig.NamespaceManager))
            {

                string source = nav.SelectSingleNode("@Source").Value;
                string destination = nav.SelectSingleNode("@Destination") == null
                                     ? "@" + source
                                     : nav.SelectSingleNode("@Destination").Value;
                dbc.Map(source, destination, false);
            }
            return dbc;
        }