Multi string search
JROW
21
Reputation points
Hey All,
I have a datatable, of which I am doing all of the functionality on the server side. However, I am a little stuck as to how to search for two strings from separate columns.
For example John Smith should bring up all john smiths in the table, below is a snippet of my search function
archiveData = archiveData.Where(m => m.Forename.Contains(searchValue.ToLower())
|| m.Surname.Contains(searchValue.ToLower())
|| m.Patient_Id.Contains(searchValue)
|| m.Request_Date.ToString().Contains(searchValue));
I understand that I need to split the string at the space at the end of the forename column then join on to the surname somehow but im a little stuck. Im still getting to grips with c#
Sign in to answer