<?xml version="1.0"?> <DTSConfiguration> <DTSConfigurationHeading> <DTSConfigurationFileInfo GeneratedDate="06/04/2018 11:06:33" GeneratedFromPackageID="{5A776659-3F33-4F34-A91A-D4BC80548271}" GeneratedFromPackageName="Package" GeneratedBy="CHN\Hasna.EK"/> </DTSConfigurationHeading> <Configuration ValueType="Boolean" Path="\Package.Connections[Flat File Connection Manager].Properties[AlwaysCheckForRowDelimiters]" ConfiguredType="Property"> <ConfiguredValue>-1</ConfiguredValue> </Configuration> -<Configuration ValueType="Int32" Path="\Package.Connections[Flat File Connection Manager].Properties[CodePage]" ConfiguredType="Property"> <ConfiguredValue>1252</ConfiguredValue> </Configuration> -<Configuration ValueType="Boolean" Path="\Package.Connections[Flat File Connection Manager].Properties[ColumnNamesInFirstDataRow]" ConfiguredType="Property"> <ConfiguredValue>-1</ConfiguredValue> </Configuration> -<Configuration ValueType="String" Path="\Package.Connections[Flat File Connection Manager].Properties[ConnectionString]" ConfiguredType="Property"> <ConfiguredValue>E:\SSIS\Test3\emp.txt</ConfiguredValue> </Configuration> </DTSConfiguration>
string filename = "emp3.txt"; string dtConfigfilename = @"E:\SSIS\x.dtsConfig"; (Package Config File Configurable) XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(dtConfigfilename); XmlNodeList nodeList = xmldoc.DocumentElement.ChildNodes; foreach (XmlElement element in nodeList) { if (element.Name == "Configuration") { if (element.Attributes["Path"].InnerText == "\\Package.Connections[Flat File Connection Manager].Properties[ConnectionString]") { element.ChildNodes[0].InnerText = @"E:\SSIS\Test2\" + filename; (Configurable file Store Folder) break; } } } xmldoc.Save(dtConfigfilename);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)