/// <summary> /// Removes the custom propert with the GUID /// </summary> /// <param name="propCollection">custom property collection of the input column</param> /// <param name="propType">>property type</param> public static void RemoveIdProperty(IDTSCustomPropertyCollection100 propCollection, PropertyType propType) { if (!NeedsMapping()) { return; } try { propCollection.RemoveObjectByID(propCollection[IdPorpertyNameList[(int)propType]].ID); } catch (Exception) { //custom property does not exists } }
public static void RemoveProperty(IDTSCustomPropertyCollection100 propertyCollection, string name) { int id = -1; foreach (IDTSCustomProperty100 existingProperty in propertyCollection) { if (existingProperty.Name == name) { id = existingProperty.ID; break; } } if (id > -1) { propertyCollection.RemoveObjectByID(id); } }