i have the following linq query that create a left join between two tables:
var joinResultRows = from leftTable in dataSet.Tables[leftTableName].AsEnumerable()
join
rightTable in dataSet.Tables[rightTableName].AsEnumerable()
on leftTable.Field<string>(leftComparedColumnName) equals rightTable.Field<string>(rightComparedColumnName)
into leftJoinedResult
select new { leftTable, leftJoinedResult };
i want to get the rows that answer this: the String value in the left column contains the string value in the right column.
i tried this :
var joinResultRows = from leftTable in dataSet.Tables[leftTableName].AsEnumerable()
join
rightTable in dataSet.Tables[rightTableName].AsEnumerable()
on leftTable.Field<string>(leftComparedColumnName).Contains(rightTable.Field<string>(rightComparedColumnName)) equals true
into leftJoinedResult
select new { leftTable, leftJoinedResult };
but it doesn't work cause rightTable isn't recognized in the left side of the join.
How do i create a join that results the String.Contains, do i do the contains in the 'where' clause or in the 'On' clause?