private void AddConvertComponent(Hashtable colConvertTable, Hashtable colConnectTable)
        {
            convertComp = pipeline.ComponentMetaDataCollection.New();
            convertComp.ComponentClassID         = DATACONVERT_GUID;
            convertComp.Name                     = "Data Conversion";
            convertComp.ValidateExternalMetadata = true;
            convertDesignTimeComp                = convertComp.Instantiate();
            convertDesignTimeComp.ProvideComponentProperties();
            IDTSInput100  cvtInput  = convertComp.InputCollection[0];
            IDTSOutput100 cvtOutput = convertComp.OutputCollection[0];
            IDTSInputColumnCollection100 cvtInputCols = cvtInput.InputColumnCollection;
            IDTSOutput100 srcOutput = srcComp.OutputCollection[0];

            pipeline.PathCollection.New().AttachPathAndPropagateNotifications(srcOutput, cvtInput);
            IDTSVirtualInput100 cvtVirInput = cvtInput.GetVirtualInput();

            int i = 0;

            foreach (object key in colConvertTable.Keys)
            {
                int srcColID = (int)key;
                cvtVirInput.SetUsageType(srcColID, DTSUsageType.UT_READONLY);
                IDTSInputColumn100 cvtInputCol = cvtInputCols.GetInputColumnByLineageID(srcColID);
                if (cvtInputCol != null)
                {
                    IDTSOutputColumn100           cvtOutputCol = convertDesignTimeComp.InsertOutputColumnAt(cvtOutput.ID, i++, "Convert_" + cvtInputCol.Name, "");
                    IDTSExternalMetadataColumn100 destCol      = (IDTSExternalMetadataColumn100)colConvertTable[key];
                    convertDesignTimeComp.SetOutputColumnDataTypeProperties(cvtOutput.ID,
                                                                            cvtOutputCol.ID, destCol.DataType, destCol.Length, destCol.Precision, destCol.Scale, destCol.CodePage);
                    // map output column and input column
                    convertDesignTimeComp.SetOutputColumnProperty(cvtOutput.ID,
                                                                  cvtOutputCol.ID, "SourceInputColumnLineageID", srcColID);
                    // add match table entry.
                    colConnectTable.Add(cvtOutputCol.ID, destCol);
                }
            }
        }
        private void AddConvertComponent(Hashtable colConvertTable, Hashtable colConnectTable)
		{
			convertComp = pipeline.ComponentMetaDataCollection.New();
			convertComp.ComponentClassID = DATACONVERT_GUID;
			convertComp.Name = "Data Conversion";
			convertComp.ValidateExternalMetadata = true;
			convertDesignTimeComp = convertComp.Instantiate();
			convertDesignTimeComp.ProvideComponentProperties();
			IDTSInput100 cvtInput = convertComp.InputCollection[0];
			IDTSOutput100 cvtOutput = convertComp.OutputCollection[0];
			IDTSInputColumnCollection100 cvtInputCols = cvtInput.InputColumnCollection;
			IDTSOutput100 srcOutput = srcComp.OutputCollection[0];

			pipeline.PathCollection.New().AttachPathAndPropagateNotifications(srcOutput, cvtInput);
			IDTSVirtualInput100 cvtVirInput = cvtInput.GetVirtualInput();

			int i = 0;
			foreach (object key in colConvertTable.Keys)
			{
				int srcColID = (int)key;
				cvtVirInput.SetUsageType(srcColID, DTSUsageType.UT_READONLY);
				IDTSInputColumn100 cvtInputCol = cvtInputCols.GetInputColumnByLineageID(srcColID);
				if (cvtInputCol != null)
				{
					IDTSOutputColumn100 cvtOutputCol = convertDesignTimeComp.InsertOutputColumnAt(cvtOutput.ID, i++, "Convert_" + cvtInputCol.Name, "");
					IDTSExternalMetadataColumn100 destCol = (IDTSExternalMetadataColumn100)colConvertTable[key];
					convertDesignTimeComp.SetOutputColumnDataTypeProperties(cvtOutput.ID,
						cvtOutputCol.ID, destCol.DataType, destCol.Length, destCol.Precision, destCol.Scale, destCol.CodePage);
					// map output column and input column
					convertDesignTimeComp.SetOutputColumnProperty(cvtOutput.ID,
					cvtOutputCol.ID, "SourceInputColumnLineageID", srcColID);
					// add match table entry.
					colConnectTable.Add(cvtOutputCol.ID, destCol);
				}
			}
		}