Hi folks
I want to search in keywords field like search key in the set.
e.g. my key is "Wing" keywords is "Wing Dress Others" with spaces what should I write instead it ?
Error : Method 'Boolean Compare(System.String, System.String)' has no supported translation to SQL.
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString.HasKeys())
{
DbDataContext db = new DbDataContext();
var Query = from n in db.Products
where Compare(n.Keywords, Request.QueryString["key"])
select n;
DataList1.DataSource = Query;
DataList1.DataBind();
}
}
bool Compare(string keywords,string key)
{
string[] items = keywords.Split(' ');
foreach (string item in items)
if (item.Equals(key)) return true;
return false;
}