Runtime Error trying to access SSIS Package variables


hi,

 

i creating custom data flow component , want access the variables collection

 

here code:

dim vars as variables

variabledispenser.getvariables(vars)

variabledispenser.lockoneforread("logid", vars)  // <- gives error, see below

dim var1 as object = vars(0)

vars.unlock()

 

when try run ssis package contains custom component, fails @ run-time following error:

error: 0xc0047062 @ data flow task, stat count [246]: system.invalidcastexception: unable cast com object of type 'system.__comobject' class type 'microsoft.sqlserver.dts.runtime.variables'. instances of types represent com components cannot cast types not represent com components; can cast interfaces long underlying com component supports queryinterface calls iid of interface.

 

any idea causes , how fix?  appreciated.

thank in advance.

 

peter

 

try instead:

 

code snippet

dim vars as variables

variabledispenser.lockoneforread("logid", vars) 

dim var1 as object = vars(0)

vars.unlock()

 

 

 

you don't want variables before you've locked one.



SQL Server  >  SQL Server Integration Services



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........