I have two tables that I use to populate the gridview. The tables have a common field called RangeActivityID. My problem is that the database is very old, and some of the old records do not match the identifiers between the tables, so I cannot add a relationship between them in the database.
I don't care about old data that doesn't match, so in my .dbml file I manually created an association to select good data from both tables. This is the LINQ query that I have:
var collective = from p in rangeConnection.RangeActivities orderby p.RangeActivityID select new { TestName = p.TestName, DateTime = p.ActivityDateTime, Notes = p.Notes,
I can set the grid data source to βcollectiveβ, and everything works, but if I uncomment the three lines with comments, the query does not return results, because the tables contain data that does not meet the association criteria. Is there a way for a LINQ query to ignore results that do not match?
Thanks in advance!
source share