strange question about DropDownList

Discussion in 'ASP .Net Web Controls' started by Detective, Jan 15, 2006.

  1. Detective

    Detective Guest

    hi:
    when i used code below and bind with access i could get the resoult what i
    want, but when i use sqlserver i got an exception about
    System.ArgumentOutOfRangeException which argument is lev.how can i solve this
    problem ,thank you:
    ///////////////////////////////////////////////////////////////////////////////////////
    <asp:DropDownList id="DropDownList2" Width="144px"
    SelectedValue='<%#DataBinder.Eval(Container.DataItem, "lev")%>' Runat=server
    >

    <asp:ListItem>test1</asp:ListItem>
    <asp:ListItem>test2</asp:ListItem>
    </asp:DropDownList>
     
    Detective, Jan 15, 2006
    #1
    1. Advertising

  2. Detective

    Axel Dahmen Guest

    From what I see, the value you provide in the "lev" column is neither
    "test1" nor is it "test2", have you checked your SQL? Perhaps you've got
    different data in you SQL Server database than you had in the Access
    database.

    HTH,
    Axel Dahmen


    --------------
    "Detective" <> schrieb im Newsbeitrag
    news:...
    > hi:
    > when i used code below and bind with access i could get the resoult what

    i
    > want, but when i use sqlserver i got an exception about
    > System.ArgumentOutOfRangeException which argument is lev.how can i solve

    this
    > problem ,thank you:)
    >

    ////////////////////////////////////////////////////////////////////////////
    ///////////
    > <asp:DropDownList id="DropDownList2" Width="144px"
    > SelectedValue='<%#DataBinder.Eval(Container.DataItem, "lev")%>'

    Runat=server
    > >

    > <asp:ListItem>test1</asp:ListItem>
    > <asp:ListItem>test2</asp:ListItem>
    > </asp:DropDownList>
     
    Axel Dahmen, Jan 16, 2006
    #2
    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. mr2_93
    Replies:
    1
    Views:
    3,604
    mr2_93
    Oct 2, 2005
  2. tshad
    Replies:
    8
    Views:
    2,236
    tshad
    Oct 19, 2005
  3. =?Utf-8?B?SnVhbmpv?=

    GridView: Filtr DropDownList from another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,871
    =?Utf-8?B?SnVhbmpv?=
    Dec 23, 2005
  4. =?Utf-8?B?SnVhbmpv?=

    GridView: Filter DropDownList for another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,304
    =?Utf-8?B?SnVhbmpv?=
    Dec 29, 2005
  5. Harvey Twyman
    Replies:
    8
    Views:
    570
    August Derleth
    Oct 25, 2003
Loading...

Share This Page