I’m running a dropdown list populated by column “CustName” from table “Customer”, and each customer has a unique id I want to use to run the queries; obviously it’s best to have the end user select by name rather than id, because it’s friendlier that way. How do I assign values to items in this databound ddl? Preferably, I’d like to assign their CustId values from the table itself. I tried simply placing the CustId field into the DataValueField attribute, but no go. Ideas?
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlCustNameSource" DataTextField="CustName"
DataValueField="CustName" AppendDataBoundItems="true">
<asp:ListItem Value="0" Text="Choose Customer" Selected="True"></asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlCustNameSource" runat="server"
ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
SelectCommand="SELECT [CustName] FROM [Customer]"></asp:SqlDataSource>
What exactly does “No Go” mean?