How to query large table and list object

travian

New Member
I have a large table 1.2 million or so rows that I need to query using. Contains on the same field. There is a field combined_name that needs to be queried using a list. I am trying to do it with just one field for now to check performance and that is reflected in the code. The way I have it written takes far too long. Is there a way where I don't have to load the table into memory?\[code\]JDataClassDataContext db = new JDataClassDataContext();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.defendants_ALLs.AsEnumerable() where c.combined_name.Contains(fullName) && firstName.Any(n => c.combined_name.Contains(n)) select c).ToList(); dlSearch.DataSource = rows;dlSearch.DataBind();\[/code\]
 
Back
Top