![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi All, I have a DTS package that I launch from a C# application. The DTS package contains an Excel Connection. AS the location of the Excel file can change dynamically, I need to be able to change the value of the Excel Connection's "ExcelFilePath" property from my piece of C# code. The problem is that I don't know how to access ExcelFilePath from the C# code. I have seen a class Microsoft.SqlServer.Dts.Runtime.Wrapper.Connection ManagerExcelClass that has a "ExcelFilePath" prperty but the doc says : This class supports the SQL Server 2005 infrastructure and is not intended to be used directly from your code. Also I don't know how to get an instance from it. I can get an instance of the class Microsoft.SqlServer.Dts.Runtime.ConnectionManager but that class is a generic class for every connection managers and does not have a ExcelFilePath property. Is there anyone who knows how I can change that property from an external piece of code? Thanks in advance, Best regards, Francois Malgreve. |
#3
| |||
| |||
|
|
Hi All, I have a DTS package that I launch from a C# application. The DTS package contains an Excel Connection. AS the location of the Excel file can change dynamically, I need to be able to change the value of the Excel Connection's "ExcelFilePath" property from my piece of C# code. The problem is that I don't know how to access ExcelFilePath from the C# code. I have seen a class Microsoft.SqlServer.Dts.Runtime.Wrapper.Connection ManagerExcelClass that has a "ExcelFilePath" prperty but the doc says : This class supports the SQL Server 2005 infrastructure and is not intended to be used directly from your code. Also I don't know how to get an instance from it. I can get an instance of the class Microsoft.SqlServer.Dts.Runtime.ConnectionManager but that class is a generic class for every connection managers and does not have a ExcelFilePath property. Is there anyone who knows how I can change that property from an external piece of code? Thanks in advance, Best regards, Francois Malgreve. |
#4
| |||
| |||
|
|
Francois Malgreve wrote: Hi All, I have a DTS package that I launch from a C# application. The DTS package contains an Excel Connection. AS the location of the Excel file can change dynamically, I need to be able to change the value of the Excel Connection's "ExcelFilePath" property from my piece of C# code. The problem is that I don't know how to access ExcelFilePath from the C# code. I have seen a class Microsoft.SqlServer.Dts.Runtime.Wrapper.Connection ManagerExcelClass that has a "ExcelFilePath" prperty but the doc says : This class supports the SQL Server 2005 infrastructure and is not intended to be used directly from your code. Also I don't know how to get an instance from it. I can get an instance of the class Microsoft.SqlServer.Dts.Runtime.ConnectionManager but that class is a generic class for every connection managers and does not have a ExcelFilePath property. Is there anyone who knows how I can change that property from an external piece of code? Thanks in advance, Best regards, Francois Malgreve. The Microsoft.SqlServer.Dts.Runtime stuff is all SQL 2005, so no good whatsoever for DTS. To change the file path set the DataSource property of the connection object. oPkg.Connections(0).DataSource = "C:\DG.xls" -- Darren http://www.sqldts.com http://www.sqlis.com |
![]() |
| Thread Tools | |
| Display Modes | |
| |