I am working in asp.net. In my application when user searches for another user by entering his name for example he enters John then all the users with name John should come up in the list. Means the application will search for users with the highest frequency of those keywords in their profiles. Lower frequency keywords should come down in the list. How to do that?
using (SqlConnection conn = new SqlConnection(strcon))
{
using (SqlCommand cmd = new SqlCommand())
{
cmd.CommandText = "select * form UserProfile where FullName like '%' + @name + '%' ";
cmd.Connection = conn;
conn.Open();
cmd.Parameters.AddWithValue("@name", name);
dlContacts.DataSource = cmd.ExecuteReader();
dlContacts.DataBind();
conn.Close();
}
}
fullName is an atriibute where user's fullname exists