score:3

Accepted answer

if you need all rows from first table whether or not they can be joined to rows from second table, you need a left join:

    var results = from table1 in table.asenumerable()
                  join table2 in comment.asenumerable()
                  on table1.field<string>("kundename") equals table2.field<string>("kundename") into joined
                  from table3 in joined.defaultifempty()
                  select new
                      {
                          kundeid = table1.field<int32?>("kundeid"),
                          kundename = table1.field<string>("kundename"),
                          produkt = table1.field<string>("produkt"),

                          comment = table3 != null ? table3.field<string>("comment") : null
                      };

this way you can get client named "miky" but the comment for him is going to be null.

score:0

your o4 object doesn't have an object in comment that has a matching kundename value, so it is not included in the results.

perhaps you did not mean to use an inner join?


Related Query

More Query from same tag