LINQ to Dataset Left Join -


sorry if question has been raised, after hours of searching, cant seem find way on how fix this. im trying create left join on 1 table when try return column on other table, null reference error raised. tried workarounds still doesn't work.

here code.

from t1 in ds.table1 join t2 in ds.table1 on t1.col2 equals t2.col1 j1 t3 in j1.defaultifempty() select new {       t1.col5,      t3.col6 }; 

if try display columns t1 works great, once display cols t3 error appears. seems null rows t3 causing error. how can determine or rather prevent null rows t3 displayed? tried using null , dbnull still no success.

i appreciate help. thanks

you need handle cases t3 null.

for example:

from t1 in ds.table1 join t2 in ds.table1 on t1.col2 equals t2.col1 j1 t3 in j1.defaultifempty() select new {       t1.col5,      col6: t3 == null ? null : t3.col6 }; 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -