Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Specified argument was out of the range of valid values. Parameter name: value? (http://www.velocityreviews.com/forums/t364258-specified-argument-was-out-of-the-range-of-valid-values-parameter-name-value.html)

darrel 08-14-2006 10:32 PM

Specified argument was out of the range of valid values. Parameter name: value?
 
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.Cou nt, 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




All times are GMT. The time now is 06:36 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.