|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
strange question about DropDownListhi:
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> 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>
Other interesting topics
detailsview,
CreateChildControls() always returns default property values 3-Tier Binding Problem ????????? Enabling/diusabling child controls Input fields are renamed with runat="server", how do I change it Website on a website. button's OnClick event runs after page databinding... Reading a public variable from a web user control Accessing Datagrid Cells on OnClick Postback Problem Retrieving Values from CheckboxList nested inside Datalist Control |
|||||||||||||||||||||||