Hi
I have got a collection in variable . I want to display all records of those collections. In Database ID is of int DataType.
In Product it is showing "2001,2002"
I am getting error- Only arguments that can be evaluated on the client are supported for the String.Contains method.
if (lstProduct.Items[i].Selected)
{
Product += lstProduct.Items[i].Value.ToString() + ",";
}
Product = Product.Trim().TrimEnd(',');
System.Collections.Generic.List
where (Product != "" ? Product.Contains(t.ID.ToString()) : 1 == 1)
select t).ToList();
Thanks
Jignesh KumarPosted Dec 5, 2022, 3:32 AM
Hello Ramco,
You can convert comma seperated string in to string array then you can check contains on that,
Aravind GovindarajPosted Dec 4, 2022, 6:10 PM
the first option please apply the indexOf instead of Contains,
second option use lstproduct.any(t.ID.Tostring)