Author: dkaur76 | Posted on: 6/25/2009 11:04:39 AM | Views : 265

I created a a drop down list which is populated by an SqlDataSource control. I want this dropdown list to display names but, when the user selects a name from the drop down, the value of the selection should be Email. This code is not behaving in this manner. Pls check my code and let me know what is wrong.
----------------------

.aspx code:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString='Data Source=cstmgr;Initial Catalog=HV;Integrated Security=True'
        SelectCommand="select User_ID,Name,Email,Phone from HV_Users Order by Name"
        ProviderName="System.Data.SqlClient" OldValuesParameterFormatString="original_{0}">
    </asp:SqlDataSource>
<asp:DropDownList ID="to" runat="server" Width="500" DataSourceID="Sql ...

Go to the complete details ...