I have a database of items that are available, but the availability varies by company. There are about 10 companies, each with their own column and a bit value if it is available to them.
This is being done on a SharePoint site in Designer, and I don't have access to the code behind.
| PhoneMake | PhoneModel | CompanyA | CompanyB |
|--------------|---------------|-------------|-------------|
| Apple | iPhone 5c | True | False |
| Apple | iphone 5s | True | True |
| Android | Note 3 | False | False |
| Android | Note 4 | False | True |
On my webpage, I have a dropdown to select your company. I then want it to select the next level of filtering (ie. manufacturer)
<asp:DropDownList runat="server" id="Company" AutoPostBack="True" EnableViewState="False">
<asp:ListItem></asp:ListItem>
<asp:ListItem Value="CompanyA">Choose A Company</asp:ListItem>
<asp:ListItem Value="CompanyB">Choose B Company</asp:ListItem>
</asp:DropDownList>
I need to take the selection of this dropdown and input it as a column to filter on in my SqlDataSource.
<asp:SqlDataSource id="SqlDataSource_PhoneMake" runat="server" __designer:commandsync="true" ProviderName="System.Data.SqlClient" ConnectionString="--yada yada--"
SelectCommand="SELECT DISTINCT [PhoneMake] FROM [table] WHERE (([PhoneMake] IS NOT NULL) AND ([@Company] = 'True'))">
<SelectParameters>
<asp:controlparameter ControlID="Company" PropertyName="SelectedValue" Name="Company" Type="String" />
</SelectParameters>
</asp:SqlDataSource>