I have a few text boxes so that we can input data, and then search DB.ClientInfo for a match
If I use the code in green with DB.ClientInfo and use the where code below:-
where p.FirstName.Contains(Name.Text)
I would get a case insensative match so working as expected
But when I use the code in red with the same where clause will only get a case sensative match which I do not want please note now using Clients<T> not DB.ClientInfo
So what I am doing is getting all the records in DB.ClientInfo and storing them in a List<T> called Clients, I then use a where clause on this list in the code in red to refine my search and this will carry on untill I get my required search result
var Clients = (from p in DB.ClientInfo
select p).ToList();
if (Name.Text != "")
{
Clients = (from p in Clients
where p.FirstName.Contains(Name.Text)
select p).ToList();
}
if (MiddleNames.Text != "")
{
Clients = (from p in Clients
where p.MiddleNames.Contains(MiddleNames.Text)
select p).ToList();
}
Can you please help so that I can search the Clients<T> list each time for a case insensative match, thanks