Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 04, 2012 03:06 PM by Mojorz
Nov 26, 2012 11:26 PM|LINK
In my asp net project I have an input field that allows keyword search
for example if I introduce "asp c#" .
In gridview after the select query :
|article_TAG | |keywords|
asp article 1 asp
asp c# article asp
asp c# article c#
In the first row there is one word that match with the search
In the second row there are two words matching ,
is there a way to count how many ocurrences occur ?
Nov 26, 2012 11:48 PM|LINK
Use autopostback textbox with sqldatasource. Use the textbox as control parameter in select parameter.
<asp:TextBox ID="TextBoxSearch" runat="server" AutoPostBack="True"></asp:TextBox>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:TESTConnectionString %>"
SelectCommand="SELECT * FROM [Persons1] WHERE ([Name] = @Name)">
<asp:ControlParameter ControlID="TextBoxSearch" Name="Name" PropertyName="Text"
You dont need write C#/VB code
Nov 27, 2012 11:09 AM|LINK
Hi oned-gk ,
My code is quite similar with yours , let me clarify my question my doubt is to count how many words
match with the select statement in a boundfield called TAG, and then order the gridview by the match count.
Thanks for your help
Dec 04, 2012 12:39 PM|LINK
Dec 04, 2012 03:06 PM|LINK
Thanks oned_gk need really to put this working.