Home All Groups Group Topic Archive Search About

strange question about DropDownList

Author
15 Jan 2006 3:20 AM
Detective
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>

Author
16 Jan 2006 12:03 AM
Axel Dahmen
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


--------------
Show quoteHide quote
"Detective" <Detect***@discussions.microsoft.com> schrieb im Newsbeitrag
news:4B9B5D8B-9352-4F9D-8760-5EF89ACCA147@microsoft.com...
> 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>