May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Field(Of T) and SetField(Of T)The Field generic extension method allows retrieving a strongly typed form for all values from a given column within a table. Basically 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. For example, the following code retrieves all strongly typed versions of orders’ data:
There is also a SetField method that allows putting ...
Read now
Unlock full access