I am facing any issue while selecting values in Linq as while selecting there may be null values but I cannot give the condition to remove that row if the value is null.

Below is the Linq query I am using. Can you please help me with this?

var value = (from data in dt.AsEnumerable()
select new{
    Test1 = data.Field<decimal>("Test1"),Test2 = data.Field<decimal?>("Test2") --Value is null
    ,Test3 = data.Field<decimal?>("Test3") --Value is null
    ,Test4 = data.Field<decimal?>("Test4") --Value is null
    ,Test5 = data.Field<DateTime?>("Test5")--Value is null });

I need to handle null in select block and not in where condition.

Related posts

Recent Viewed