I have a Query that currently has a search box that is used as the parameter to query the results off of the "Part Number" column.
In the Gridview that shows the results there are Five columns:
Manufacturer, Location, Description, PartNumber, QTY
I would like to modify this query:
To be able to search the Manufacturer, Description, and PartNumber columns instead of just the PartNumber column.
I have tried a few things and cannot get it to recognize my query in different columns.
Right at the end of the query you see:
Is there a way to make it say "OR Stock_MFG LIKE '%' + ? + '%' OR Stock....." etc??
I know it is possible... any Ideas?
In the Gridview that shows the results there are Five columns:
Manufacturer, Location, Description, PartNumber, QTY
I would like to modify this query:
Code:
<asp:SqlDataSource ID="dsSearch" runat="server"
ConnectionString="<%$ ConnectionStrings:SERVER-B InTables %>"
SelectCommand="SELECT Stock_Mfg AS Manufacturer, Stock_Num AS Location, Stock_Desc AS Description, Stock_QOH AS QOH, GMPN + ' ' + DelphiPN + ' ' + FCIPN + ' ' + MolexPN + ' ' + MolexPN + ' ' + TycoPN + ' ' + YazakiPN + ' ' + EPCPN + ' ' + Other AS PN FROM Stock_Info WHERE (Stock_QOH > 0) AND (GMPN + ' ' + DelphiPN + ' ' + FCIPN + ' ' + MolexPN + ' ' + MolexPN + ' ' + TycoPN + ' ' + YazakiPN + ' ' + EPCPN + ' ' + Other LIKE '%' + ? + '%') UNION ALL SELECT Stock_Mfg AS Manufacturer, Stock_Num AS Location, Stock_Desc AS Description, Stock_QOH AS QOH, Stock_PN AS PN FROM ManEntry WHERE (Stock_QOH > 0) AND (Stock_PN LIKE '%' + ? + '%') ORDER BY Manufacturer, Location"
ProviderName="<%$ ConnectionStrings:SERVER-B InTables.ProviderName %>" onselected="SqlDataSource1_Selected"
>
<SelectParameters>
<asp:ControlParameter ControlID="txtSearch" Name="?" PropertyName="Text"
DefaultValue="%" />
<asp:ControlParameter ControlID="txtSearch" DefaultValue="%" Name="?"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
To be able to search the Manufacturer, Description, and PartNumber columns instead of just the PartNumber column.
I have tried a few things and cannot get it to recognize my query in different columns.
Right at the end of the query you see:
Code:
(Stock_PN LIKE '%' + ? + '%')
Is there a way to make it say "OR Stock_MFG LIKE '%' + ? + '%' OR Stock....." etc??
I know it is possible... any Ideas?