D
darrel
What does this error mean?
Specified argument was out of the range of valid values. Parameter name:
value
System.Web
It's being thrown here:
DDL_SubCategory.Enabled = True
DDL_SubCategory.DataSource = DS
DDL_SubCategory.DataTextField = "categoryName"
DDL_SubCategory.DataValueField = "categoryID"
DDL_SubCategory.DataBind()
DDL_SubCategory.Items.Insert(DS.Tables(0).Rows.Count, New ListItem("-none-",
0))
It's happening on the DDL_SubCategory.DataBind() line. There's no parameter
there, so I'm confused as to what is the problem.
After some googling, the answer seems to be to add this line before the
databind:
DDL_SubCategory.SelectedValue = Nothing
That works! But I don't know why. Can anyone explain?
-Darrel
Specified argument was out of the range of valid values. Parameter name:
value
System.Web
It's being thrown here:
DDL_SubCategory.Enabled = True
DDL_SubCategory.DataSource = DS
DDL_SubCategory.DataTextField = "categoryName"
DDL_SubCategory.DataValueField = "categoryID"
DDL_SubCategory.DataBind()
DDL_SubCategory.Items.Insert(DS.Tables(0).Rows.Count, New ListItem("-none-",
0))
It's happening on the DDL_SubCategory.DataBind() line. There's no parameter
there, so I'm confused as to what is the problem.
After some googling, the answer seems to be to add this line before the
databind:
DDL_SubCategory.SelectedValue = Nothing
That works! But I don't know why. Can anyone explain?
-Darrel