次のようなドロップダウンリストボックスがあります。ある条件下では、データバインド イベントで、bitActive が 0 (非アクティブ) に設定されているアイテムを削除したいと考えています。一部の条件下でのみ削除したいので、 selectCommand に WHERE bitAcive!=0 を入れませんでした。アイテムを反復して bitActive の値を確認する方法はありますか?
<tr>
<td width="30%" align="right">Location<span class="littlefont">*</span></td>
<td width="70%" align="left">
<asp:DropDownList ID="ddlLocation" runat="server"
DataSourceID="SqlDSLocation" DataTextField="txtRefLocation_Name"
DataValueField="intRefLocation_ID" ondatabound="ddlLocation_DataBound">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDSLocation" runat="server"
ConnectionString="<%$ ConnectionStrings:SPRConnectionString %>"
SelectCommand="SELECT DISTINCT [intRefLocation_ID], [txtRefLocation_Name], [location], [bitActive] FROM [tblRefLocation] ORDER BY [intRefLocation_ID]">
</asp:SqlDataSource>
</td>
</tr>