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:
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
Post a Comment