Code:
I'm trying to concatenate two table columns and have them display in a dropdown list, but the list shows as empty. If I replace the "itemText" with "descr" below, then the dropdownlist gets filled. It's not clear what I should have to the right of the SQL "AS" clause - itemText, @itemText, or [itemText] - but no matter what I put the SQL runs without error, but nothing displays in the list.
In my dropdownlist datasource I have:
SelectCommand="SELECT [heading], [heading] + REPLICATE('.', 20 - LEN([heading])) + [descr] AS itemText FROM Testfile"
For the sqldatasource I also Have:
<SelectParameters>
<asp:Parameter Name="itemText" Type="String" />
</SelectParameters>
For the dropdownlist I have:
<asp:DropDownList ID="DropDownList" runat="server"
DataSourceID="SqlDataSource" DataTextField="itemText"
DataValueField="ID_KEY" AutoPostBack="True"
</asp:DropDownList>