Excel连接管理器的EzApi问题

时间:2013-07-02 15:18:15

标签: excel reflection ssis window ezapi

EzApi用于创建SSIS包,包通过oledb连接管理器读取excel文件(microsoft.ace.oledb.12.0)当我在读取excel文件的数据流后创建EzExecSQLTask对象时,

我得到了例外:object does not match the target type

调试EzApi代码后,我发现下面的行正在生成异常

host.Properties["TimeOut"].SetValue(host, value);

似乎当通过反射设置属性时,它找不到目标对象。

代码在widows xp机器上运行正常,但在Windows Server 2012上导致问题。

堆栈跟踪

at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)
   at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
   at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
   at Microsoft.SqlServer.Dts.Runtime.ManagedHelper.ManagedPropertyHelper.SetPropertyValue(Object o, Int32 index, Object value)
   at Microsoft.SqlServer.Dts.Runtime.DtsProperty.SetValue(Object o, Object value)
   at Microsoft.SqlServer.SSIS.EzAPI.EzExecSqlTask.set_TimeOut(UInt32 value) in d:\ROI_ETL\ROi\ETL\Optime.ISS.ETL.EzApi\EzExecutables.cs:line 751
   at Microsoft.SqlServer.SSIS.EzAPI.EzExecSqlTask.InitializeTask() in d:\ROI_ETL\ROi\ETL\Optime.ISS.ETL.EzApi\EzExecutables.cs:line 740
   at Microsoft.SqlServer.SSIS.EzAPI.EzExecSqlTask..ctor(EzContainer parent) in d:\ROI_ETL\ROi\ETL\Optime.ISS.ETL.EzApi\EzExecutables.cs:line 732
   at Microsoft.SqlServer.SSIS.EzAPI.Common.ComponentWrapper.CreateSQLTaskWithExpression(EzContainer p, String name, String sql, EzConnectionManager cm) in d:\ROI_ETL\ROi\ETL\Optime.ISS.ETL.EzApi\Common\ComponentWrapper.cs:line 55
   at Microsoft.SqlServer.SSIS.EzAPI.SSI_Wrapper.SSIPackage.LogMessage(String stepID, String stepName, String userID, String statusID, String message, String sqlTaskName, EzExecutable attachToComp, EzConnectionManager cm) in d:\ROI_ETL\ROi\ETL\Optime.ISS.ETL.EzApi\SSI Wrapper\SSIPackage.cs:line 723
   at Microsoft.SqlServer.SSIS.EzAPI.SSI_Wrapper.SSIPackage.CreatePackage(Int64 userID, Nullable`1 sourceID, Int64 taskID, Boolean isSystemTask, StepDTO step, List`1 execStatus) in d:\ROI_ETL\ROi\ETL\Optime.ISS.ETL.EzApi\SSI Wrapper\SSIPackage.cs:line 178
   at Optime.ISS.ETL.WebAPI.SSISPackageController.ExecuteTask(TaskDTO task) in d:\ROI_ETL\ROi\ETL\Optime.ISS.ETL.WebAPI\SSISPackageController.cs:line 77

更多信息

当使用microsoft.ace.oledb.12.0连接到excel文件时,仅在Windows Server 2012上发生问题。使用microsoft.ace.oledb.12.0 32位驱动程序的窗口xp中相同的代码可以正常工作

请帮助......我们可以继续前进。

请建议正确的论坛。

0 个答案:

没有答案