DataReaderExtensions.GetFieldType(DbDataReader, String) DataReaderExtensions.GetFieldType(DbDataReader, String) DataReaderExtensions.GetFieldType(DbDataReader, String) DataReaderExtensions.GetFieldType(DbDataReader, String) Method

定义

获取指定列的数据类型。Gets the data type of the specified column.

public:
[System::Runtime::CompilerServices::Extension]
 static Type ^ GetFieldType(System::Data::Common::DbDataReader ^ reader, System::String ^ name);
public static Type GetFieldType (this System.Data.Common.DbDataReader reader, string name);
static member GetFieldType : System.Data.Common.DbDataReader * string -> Type
<Extension()>
Public Function GetFieldType (reader As DbDataReader, name As String) As Type

参数

reader
DbDataReader DbDataReader DbDataReader DbDataReader

要从中获取字段类型的数据读取器。The data reader to get the field type from.

name
String String String String

列的名称。The name of the column.

返回

指定列的数据类型。The data type of the specified column.

异常

指定的名称不是有效的列名。The name specified is not a valid column name.

指定的强制转换无效。The specified cast is not valid.

适用于

另请参阅