I am working with another programmer's code. Had it been my code from scratch, option strict on would've been set. But it wasn't. So I turned it on and I have 46 errors. That doesn't bother me as they're usually simple issues but I do not understand late binding. What is wrong with this code?
I am getting the late binding error on the blue lines.Code:Dim Level2ApproverList As New ListItemCollection For Each approver As String In Level2Approvers Dim ItemArray As Array = Split(approver, ",") Dim NewListItem As New ListItem NewListItem.Value = ItemArray(0) NewListItem.Text = IIf(UBound(ItemArray) >= 1, ItemArray(1), String.Empty) Level2ApproverList.Add(NewListItem) Next
Want to know what really ticks me off? When I googled this and went to Microsoft it said: To correct this error
Change Option Strict to Off, by removing the On after it or explicitly specifying Off.
Seriously? Maybe I'm too anal, but they should be telling you how to fix it, not telling you how to run away from it. Can I find that out here? Thanks.




Reply With Quote