I receive a DataTable from excel file and data in the first Column looks like this:
11129
DBNull.Value
29299
29020
DBNull.Value
29020
I'm using LINQ to select distict and it works if there are no DBNull.Value values as below. albumIds = dt.AsEnumerable().Select(p => (int)p.Field("F1")).Distinct().ToArray();
But if DBNull.Value present which represent empty excel cells I get conversion errors.
How do I filter out those DBNull.Value from my result set?
Thank you