Trying to read from generic IList but getting "Option Strict On disallows late binding" restriction

R

Ronald S. Cook

Hi,

I'm wanting to iterate over a generic IList, but the code won't compile
because the blue sqiggle line under:

_DataRow("SecurityFunctionName") = _IList(i).SecurityFunctionName;

sez "Option Strict On disallows late binding"

If I comment out the line and get to that place in the debugger, I can pull
the value in the Innediate window and it works. But I can't get around the
late binding restriction.

I've tried using ctype but that didn't seem to help.

Any feedback greatly appreciated.

Ron
 
L

Lasse Vågsæther Karlsen

Ronald said:
Hi,

I'm wanting to iterate over a generic IList, but the code won't compile
because the blue sqiggle line under:

_DataRow("SecurityFunctionName") = _IList(i).SecurityFunctionName;

sez "Option Strict On disallows late binding"

If I comment out the line and get to that place in the debugger, I can
pull the value in the Innediate window and it works. But I can't get
around the late binding restriction.

I've tried using ctype but that didn't seem to help.

Any feedback greatly appreciated.

Ron

I'm pretty sure you should take this question to the VB.NET forum instead.

Off the top of my head, have you checked that:

_DataRow is indexable by a string? (not that the object in _DataRow is,
but that the type you've declared _DataRow as, is)
_IList declares SecurityFunctionName?

Other than that, you'll just have to ask a VB guy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top