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

  • Thread starter Thread starter Ronald S. Cook
  • Start date Start date
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
 
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.
 
Back
Top