Reputation: 21
public string getSearchResult(string qry, string options, string noOfRecords, string strrefine)
{
string Query = "";
if (qry == "") return "";
string[] qrymod = qry.Split(' ');
if (qrymod.Length > 1)
{
for (int i=1; qrymod.Length > i; i++)
{
qry =qrymod[i];
}
}
//qry = qrymod[0];
qry = qry.Replace("\\", "\\\\").Replace("%", "\\%").Replace("_", "\\_");
if (options == "A" || options == "AC")
Query += " Select top " + noOfRecords + " cast(activityid as nvarchar(50)) as 'id',title as 'title',cast(description as varchar(200)) as 'desc' ,'AC' as 'Type' from searchActivity WHERE title like '%" + chkText(qry) + "%' or description like '%" + chkText(qry) + "%' escape '\\' ";
}
I can perform search from this function but the issue is whenever i am entering the text with two words it searches the word after entering space the function will start searching the 2nd word i want to compile the search result to search both the words
Upvotes: 0
Views: 131