i have the following code:
<asp:SqlDataSource ID="SqlInvent" runat="server" ConnectionString="<%$ ConnectionStrings:InventConnectionString %>" FilterExpression="(descripcion LIKE '%{0}%') AND model LIKE '%{4}%' AND code_Item LIKE '%{1}%' AND desc_grupo LIKE '%{2}%' AND desc_brand2 LIKE '%{3}%'"
SelectCommand="SELECT Brand.code_Item, Item_unidad.desc_unidad, Brand.descripcion, Item_grupo.desc_grupo, Item_tipo.Desc_tipo, Item_brand2.desc_brand2, Brand.model FROM Brand INNER JOIN Item_grupo ON Brand.grupo_art_id = Item_grupo.grupo_art_id INNER JOIN Item_brand2 ON Brand.brand2_id = Item_brand2.brand2_id INNER JOIN Item_tipo ON Brand.tipo_art_id = Item_tipo.tipo_art_id INNER JOIN Item_unidad ON Brand.unidad_id = Item_unidad.unidad_id">
<FilterParameters>
<asp:ControlParameter ControlID="txtSearch" ConvertEmptyStringToNull="false" Name="descripcion" PropertyName="Text" />
<asp:ControlParameter ControlID="txtSearchCod" ConvertEmptyStringToNull="false" Name="searchcode" PropertyName="Text" />
<asp:ControlParameter ControlID="ddlSearchGrupo" ConvertEmptyStringToNull="false" Name="searchGrupo" />
<asp:ControlParameter ControlID="ddlSearchBrand2" ConvertEmptyStringToNull="false" Name="searchBrand2" />
<asp:ControlParameter ControlID="txtSearchMod" ConvertEmptyStringToNull="false" Name="searchModel" PropertyName="Text" />
</FilterParameters>
</asp:SqlDataSource>
what does it do.. the SQLDataSource populates a Gridview with 5,000+ items paged on 30 items each, and i have 3 textboxes and 2 dropdownlist so i can search: description, model, code, brand and group
However since im using FilterExpression
as follows descripcion LIKE '%{0}%'
it would search for the exact word(s) in any place of the string.
ex. if i enter in the textbox red card i would find all the items with red card regarding position
1 red card bla bla
red card blabla
bla bla bla red card
what im trying to do, is to split that word and for me to search individually like ALL items that have red and ALL items that have cards or All the items that contains both words
red cake over the oven
a blue card deck
i have a card that is red
i would like to know if there is any way that i could acomplish this with the current aproach. i have seen other questions, they are similar but doesn't really come close to what am i doing right now.