Apology first, I am really beginner with the LINQ, hence the question.
I am being unable to catch values that are null form the database. I am making a LINQ to DataTable. I am checking the double type.
This is the code I have:
var results2 = from myRow in table.AsEnumerable()
where myRow.Field<double>("Cost") == 0
select myRow;
That Code works fine if a value is zero. How Do I make it check for null as well?
Another question is also related to this issue:
I have this code:
var results = from myRow in table.AsEnumerable()
where myRow.Field<string>("Name") == "test"
select myRow;
And that works just fine if the value is test. How do I check if the "Name" column is empty/null??
myRow.Field<double?>("Cost") == null?.AsEnumerable()? Are you sure this is Linq to SQL? Why not use a typed data context?