I haven't read that page but I would say yes, he is off-base. First up, you are using a typed DataSet, so you don't use the Rows collection. The table itself is the collection, so your code should be: Code:
myDataset.myTable(1).CustomerBirthday
As for the "issue" of NULL values, the typed DataSet provides functionality for that specifically. If you hadn't used the Rows collection then you would have got a typed DataRow instead of a standard DataRow and Intellisense would have shown you those members: Code:
Dim myTypedDataRow = myTypedDataTable(rowIndex)
Dim customerBirthday As Date? = If(myTypedDataRow.IsCustomerBirthdayNull(), DirectCast(Nothing, Date?), myTypedDataRow.CustomerBirthday)
Code:
Dim myTypedDataRow = myTypedDataTable(rowIndex)
If customerBirthday.HasValue Then
myTypedDataRow.CustomerBirthday = customerBirthday.Value
Else
myTypedDataRow.SetCustomerBirthdayNull()
End If It is a bit cumbersome, mainly because typed DataSets were introduced before nullable value types. This is a good reason to use something like the Entity Framework in preference to typed DataSets.
Bookmarks