Specified argument was out of the range of valid values. Parameter name: value?

Discussion in 'ASP .Net' started by darrel, Aug 14, 2006.

  1. darrel

    darrel Guest

    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
     
    darrel, Aug 14, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Todd Perkins
    Replies:
    0
    Views:
    9,437
    Todd Perkins
    Sep 15, 2004
  2. subdhar
    Replies:
    9
    Views:
    27,911
    Subhashish Dhar
    Nov 9, 2004
  3. Chapi
    Replies:
    2
    Views:
    10,847
    Chapi
    May 26, 2008
  4. Dave
    Replies:
    0
    Views:
    1,766
  5. Dave
    Replies:
    11
    Views:
    864
    Jesse Houwing
    Jul 9, 2006
Loading...

Share This Page