As I now know, the Fields extension method on the DataRow class can handle null values. I worked that out by reading the documentation but I think that doco contains an error because it doesn't actually use nullable types in the code example. That original code should be redone like this:Because the generic type of the Field method is nullable it can handle null values.Code:Dim myCustomers = From Cust In myDataset.Customers _ Select CustomerId = Cust.CustomerId, _ CustomerName = Cust.CustomerName, _ ExpiryDate = Cust.Field(Of Date?)("ExpiryDate") DataGridView1.DataSource = myCustomers.ToList




Reply With Quote