My form has two dropdown fields for unit type. They are UnitType and UnitTypeTwo. Here is the SelectCommand of the SqlDataSource:
SELECT v.venId, v.venNm, v.venStAdd, v.venUnitType, ut.unitType, v.venUnit,
v.venUnitTypeTwo, ut2.unitType, v.venUnitTwo, v.venCity, v.venStateAbbr,
v.venZip, v.venCountry, v.venPh, v.venCmnts, v.venActive
FROM vendors v
LEFT JOIN unitTypes ut
ON v.venUnitType = ut.unitTypeId
LEFT JOIN unitTypes ut2
ON v.venUnitTypeTwo = ut2.unitType
WHERE ([venId] = @venId)
Here is the ItemTemplate of the FormView:
<ItemTemplate>
<asp:Label Text='<%# Eval("venId") %>' runat="server" ID="venIdLabel" Visible="false" /><br />
<div class="row">
<div class="col-md-3">
<strong>Vendor</strong><br />
<asp:Label Text='<%# Bind("venNm") %>' runat="server" ID="venNmLabel" /><br />
</div>
<div class="col-md-3">
<strong>Address</strong><br />
<asp:Label Text='<%# Bind("venStAdd") %>' runat="server" ID="venStAddLabel" /><br />
</div>
<div class="col-md-3">
<strong>Unit Type</strong><br />
<%--<asp:Label Text='<%# Bind("venUnitType") %>' runat="server" ID="venUnitTypeLabel" /><br />--%>
<asp:Label Text='<%# Bind("ut.unitType") %>' runat="server" ID="venUnitTypeLabel" /><br />
</div>
<div class="col-md-3">
<strong>Unit</strong><br />
<asp:Label Text='<%# Bind("venUnit") %>' runat="server" ID="venUnitLabel" /><br />
</div>
</div>
<div class="row">
<div class="col-md-3">
<strong>Unit Type</strong><br />
<%--<asp:Label Text='<%# Bind("venUnitTypeTwo") %>' runat="server" ID="venUnitTypeTwoLabel" /><br />--%>
<asp:Label Text='<%# Bind("ut2.unitType") %>' runat="server" ID="venUnitTypeTwoLabel" /><br />
</div>
<div class="col-md-3">
<strong>Unit</strong><br />
<asp:Label Text='<%# Bind("venUnitTwo") %>' runat="server" ID="venUnitTwoLabel" /><br />
</div>
<div class="col-md-3">
<strong>City:</strong><br />
<asp:Label Text='<%# Bind("venCity") %>' runat="server" ID="venCityLabel" /><br />
</div>
<div class="col-md-3">
<strong>State</strong><br />
<asp:Label Text='<%# Bind("venStateAbbr") %>' runat="server" ID="venStateAbbrLabel" /><br />
</div>
</div>
<div class="row">
<div class="col-md-3">
<strong>Zip Code</strong><br />
<asp:Label Text='<%# Bind("venZip") %>' runat="server" ID="venZipLabel" /><br />
</div>
<div class="col-md-3">
<strong>Country</strong><br />
<asp:Label Text='<%# Bind("venCountry") %>' runat="server" ID="venCountryLabel" /><br />
</div>
<div class="col-md-3">
<strong>Phone</strong><br />
<asp:Label Text='<%# Bind("venPh") %>' runat="server" ID="venPhLabel" /><br />
</div>
<div class="col-md-3">
<strong>Active</strong><br />
<asp:CheckBox Checked='<%# Bind("venActive") %>' runat="server" ID="venActiveCheckBox"
Enabled="false" /><br />
</div>
</div>
<div class="row">
<div class="col-md-3">
<strong>Comments</strong><br />
<asp:Label Text='<%# Bind("venCmnts") %>' runat="server" ID="venCmntsLabel" /><br />
</div>
</div>
<asp:LinkButton runat="server" Text="Edit" CommandName="Edit" ID="EditButton" CausesValidation="False"
CssClass="cmdlinkpdg" /> <%--<asp:LinkButton runat="server" Text="Delete" CommandName="Delete" ID="DeleteButton" CausesValidation="False" /> --%><asp:LinkButton
runat="server" Text="New" CommandName="New" ID="NewButton" CausesValidation="False" />
</ItemTemplate>
The first dropdown list works just fine until I modify the SelectCommand to include the value of the second unit type. How do I need to modify the FormView or the SelectCommand, or both - if this is possible?
Thanks, J.