Option Strict On problem with dropdownlist

anithajones

Newcomer
Joined
Dec 6, 2005
Messages
1
I get "Option Strict disallows late binding" error on the lines shown. What am I doing wrong?
Dim dr As DataRow
dr = ddlDC.DataSource.Tables(0).NewRow
dr.Item(0) = "ALL"
dr.Item(1) = "ALL"
ddlDC.DataSource.Tables(0).Rows.InsertAt(dr, 0)
 
dr = ddlDC.DataSource.Tables(0).NewRow

this sets dr as a typed datarow...a class that is dynamically created when you filled the dataset

Changing the declaration should fix the problem.

Dim dr As ddlDC.DataSource.Tables(0).NewRow
 
Back
Top