July 2015
Intermediate to advanced
1300 pages
87h 27m
English
The Field generic extension method allows retrieving a strongly typed form for all values from a given column within a table. Field receives as an argument the column name or the column index and then tries to convert values in a column into the specified type. Because of this, when using Field you should also predict some exceptions, such as InvalidCastException that can occur if the conversion fails, NullReferenceException if Field attempts to access a non-Nullable null value, and IndexOutOfRangeException if you pass an invalid index for the column. The following code retrieves all strongly typed versions of orders’ data:
Private Sub FieldDemo() Try Dim query ...