我有一个下拉列表,其中包含姓氏列表。问题是有些人的姓氏相同,出于某种原因,它总是显示一个名字。下拉列表连接到 sql server,这里是下拉列表的代码:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource3" DataTextField="lName" DataValueField="lName"
AppendDataBoundItems="True"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Value="0">Select</asp:ListItem>
</asp:DropDownList>
这是SqlDataSource:
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:TestDBConnectionString1 %>"
SelectCommand="SELECT DISTINCT [lName] FROM [CoaTest]"></asp:SqlDataSource>
先感谢您!