Using asp.net, I have a dropdownlist with list of destinations. these are used to send a query to a mysql database. However, I was informed that other data will have destination codes instead of the actual destination name, so for instance, the column for destination in the database will have records with the name Manchester while others will have the code MAN. So at the moment, I have a limitation in the the asp.net form - I can only query the destination name so records with the code will not be resturned. below in the form and as you can see, it only has the name.
Is there a way in the form to make it query both the name and the code? without changing the database and also using the dropdown list
<asp:DropDownList id="departurepoint" runat="server">
<asp:ListItem Selected="True">Select a Destination</asp:ListItem>
Thanks in advance
You may be able to create a table that holds a list of destinations and their codes, I am presuming they are airport codes. In the table list the name and it's code, I believe you can then map these to a drop down list. In normal HTML the value sent by the form and the description of the selected item can be different, I am assuming this can also be done with an asp.net drop down as well.
Well, that is rather bad database design, and you are going to end up shooting yourself in the foot. You are going to have to map each name to a code. If is Manchester is selected search for Manchester or MAN. But you are going have to do this for each item. Are you value can be MAN,Manchester, then you split on , and you will have both. But that is not great and in the end it would be best to fix the database accordingly.