I'm trying to test out the new Null-Conditional operator in .NET 4.6 (using VB.Net), but it isn't working for me when retrieving null values from fields of a database record, and I can't understand why. Here's my code:
Dim dbtable As New DataSet1.MyDataTable
Dim dbrecord As DataSet1.MyRecord
dbrecord = dbtable.NewMyDataTableRow
Dim val = dbrecord.CustomerName?.ToString
Yet, it still throws a System.Data.StrongTypingException.
What am I doing wrong?