Hi, I am trying to use VB.net to run a DTS package that i have created. I have managed to get the VB.net code to successfully execute the package and change two of the global variables dynamically, but i have not been able to dynamically change the DataSource for the csv text file that i am trying to output. I am very new to DTS and SQL, and have very likely made a silly mistake. This is the code i have (i have commented where the problem appears to be):Dim oPackage As New DTS.PackageDim oConnoPackage.LoadFromSQLServer(<Server IP>, <UserName>, <Password>, _ DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, , , , _ <DTS Package Name>)For Each oStep As DTS.Step In oPackage.Steps oStep.ExecuteInMainThread = TrueNext' Remove the global variables.oPackage.GlobalVariables.Remove(2)oPackage.GlobalVariables.Remove(1)oPackage.GlobalVariables.AddGlobalVariable("StartDate", tpStart.Text)oPackage.GlobalVariables.AddGlobalVariable("EndDate", dtpStart.Text)' -- ** ' This is where my problem is, the following line won't' compile. But this is how it is done in all the examples i ' have found.' ** --' Get Named ConnectionoConn = oPackage.Connections("Text File (Destination)")' Set Filename to new valueoConn.DataSource = txtFile.Text'Run the package and release references.oPackage.Execute()oPackage.UnInitialize()oPackage = NothingoConn = NothingCan anyone help? Thanks-Rob-