DbDataReaderExtensionsFieldValueOrDefaultT Method

Gets the field value or default(), if the value is DBNull.

Namespace:  Dundas.BI.Data
Assembly:  Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (24.3.0.1000)
Syntax
public static T FieldValueOrDefault<T>(
	this DbDataReader target,
	string name
)

Parameters

target
Type: System.Data.CommonDbDataReader
The data reader.
name
Type: SystemString
The name of the column.

Type Parameters

T
The type of the value to be returned.

Return Value

Type: T
The field value or default(), if the value is DBNull.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DbDataReader. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptiontarget or name is .
See Also