<asp:DropDownList ID="assignto" runat="server" AutoPostBack="True"
DataSourceID="assignedto" DataTextField="fnamelname" DataValueField="id" Height="16px"
Width="121px">
</asp:DropDownList>
<asp:SqlDataSource ID="assignedto" runat="server"
ConnectionString="<%$ ConnectionStrings:pmt %>"
SelectCommand="SELECT [id], [fname], [lname],fname+lname AS [fnamelname] FROM [userreg] WHERE ([role] = @role)">
<SelectParameters>
<asp:Parameter DefaultValue="Employee" Name="role" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
Please Note:-
check the above bold characters in order to solve the query of concatenate two fields to display in dropdownlist
Enjoy Coding...
None
0 Points
1 Post
Concatenate Two Fields to Display in Dropdownlist
Mar 25, 2012 10:58 AM|mehul0810|LINK
All-Star
101931 Points
20703 Posts
Moderator
Re: Concatenate Two Fields to Display in Dropdownlist
Mar 25, 2012 11:34 AM|MetalAsp.Net|LINK
All-Star
17915 Points
5679 Posts
MVP
Re: Concatenate Two Fields to Display in Dropdownlist
Mar 26, 2012 08:12 AM|sjnaughton|LINK
is this to do with Dynamic Data as introduce in .Net 3.5 SP1?
Always seeking an elegant solution.
All-Star
94130 Points
18109 Posts
Re: Concatenate Two Fields to Display in Dropdownlist
Mar 26, 2012 09:51 PM|Decker Dong - MSFT|LINK
Hello mehul0810:)
It seems that you are now sharing us a nice answer for that!Many thanks!