i can simply get one item of an array by
string myKeyword="test";
GridView1.DataSource = from e in table where e.Keyword.Equals(myKeyword) select e;
how can i extend it to an array? I want something like:
string[] myKeywords={"test1", "test"};
GridView1.DataSource = from e in table where e.Keyword.Equals(myKeywords) select e; // something like this?
i want to get all elements where the Keyword is equal to one of the the Keywords in myKewords
You need to use the Enumerable.Contains method:
var temp = (from e in table where myKeywords.Contains(e.Keyword)).ToArray();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With