Hello everyone,
I'm in need of some help searching a database using multiple words from a textbox showing in gridview.
It works fine, i click button and the gridview shows all the right records.Code:<asp:TextBox ID="TextBox1" runat="server" Width="382px" AutoPostBack="True"></asp:TextBox> <asp:Button ID="Button1" runat="server" style="height: 26px" Text="Button" /> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" Width="346px" DataSourceID="AccessDataSource1"> </asp:GridView> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/cod_postais.mdb" SelectCommand="SELECT [Local], [Morada], [Lugar] FROM [cod_c] WHERE ([Morada] LIKE '%' + ? + '%')"> <SelectParameters> <asp:ControlParameter ControlID="TextBox1" Name="Morada" PropertyName="Text" Type="String" /> </SelectParameters> </asp:AccessDataSource>
The problem is when i use more then 1 word in textbox. it shows nothing.
The record in the database field may have several words, so i need to search using all words in textbox.
any help understanding the problem is much apreciated
thanks
Vasco Brito




Reply With Quote