Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to display two fields in DropDown list
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Databases
Title:
How to display two fields in DropDown list
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01326521
Message ID:
01326521
Views:
63
Hi everybody,

This should be a very simple question. I have a SQLDataSource to Display School. I added a new field called SchoolPhone and I'd like to display both fields in my DropDown.

Here is what I've tried
<asp:SqlDataSource ID="SchoolsDataSource" ConnectionString="<%$ ConnectionStrings:FCCMSConnectionString %>"
        
        SelectCommand="SELECT RTRIM([School]) + ' - ' + [SchoolPhone] as SchoolInfo, [School], [SchoolPhone] FROM [Schools] WITH (NOLOCK) WHERE ([siteID] = @siteID)" 
        runat="server">
but it still only displays School. Should I try to bind to SchoolInfo?

Thanks in advance.

UPDATE. Yes, seems to work. Auntie Emma syndrom again.
If it's not broken, fix it until it is.


My Blog
Reply
Map
View

Click here to load this message in the networking platform