Mektrortagrirty
New Member
I am trying to parse a comma delimited text box as a list and then check if a string has any of the strings in the list. For instance:txtLastName: smit txtFirstName: joh,jon,j. I need to search a database that has a field combined_name that includes smith and joh or jon or j. in it.This is what I have so far:\[code\] var fullName = txtSearchBox0.Text.Trim(); List<string> firstName = new List<string>(txtSearchBox1.Text.Split(',').Select(x => Convert.ToString(x)).ToList()); var rows = (from c in db.GetTable<defendants_ALL>() where c.combined_name.Contains(fullName) && c.combined_name.Contains(firstName) select c).ToList();\[/code\]This does not work with firstName being a list but it does if it is var like the last name. Is it possible to use .Contains with the list variable or is there another way I need to do this??