SqlColumnBinder 类

此选件类有效地是一个 convienent 方式访问结果列。 它缓存列序号。

若要使用此选件类,请创建静态实例时,通过在列名传递给构造函数,并使用 GetXXX 方法运行时检索值。

在第一 GetXXX() 调用之后,将缓存列数。

应重新使用此对象在将来的所有调用结果同一形状设置。

继承层次结构

System.Object
  Microsoft.TeamFoundation.Framework.Server.SqlColumnBinder

命名空间:  Microsoft.TeamFoundation.Framework.Server
程序集:  Microsoft.TeamFoundation.Framework.Server(在 Microsoft.TeamFoundation.Framework.Server.dll 中)

语法

声明
Public Class SqlColumnBinder
public class SqlColumnBinder

SqlColumnBinder 类型公开以下成员。

构造函数

  名称 说明
公共方法 SqlColumnBinder 创建 SqlColumnReader 以读取名为列

页首

属性

  名称 说明
公共属性 ColumnName 此联编程序也是绑定的列的名称。

页首

方法

  名称 说明
公共方法 ColumnExists 选定列是否在结果。
公共方法 Equals 确定指定的对象是否等于当前对象。 (继承自 Object。)
受保护的方法 Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 GetBoolean(DbDataReader) 检索该列的值作为 bool 给定读取器。 如果该列为空,则将引发异常
公共方法 GetBoolean(DbDataReader, Boolean) 检索该列的值作为 bool 给定读取器。 如果该列为空,则将引发异常
公共方法 GetBoolean(DbDataReader, Boolean, Boolean%) 检索该列的值作为 bool 给定读取器。 如果该值为空,则将输出参数设置为 true。
公共方法 GetByte(DbDataReader) 检索该列的值作为 int 给定读取器。 如果该列为空,则将引发异常
公共方法 GetByte(DbDataReader, Byte) 检索该列的值作为 int 给定读取器。 如果该列为空,则将引发异常
公共方法 GetByte(DbDataReader, Byte, Byte) 检索该列的值作为 int 给定读取器。 如果该列为空,则将引发异常
公共方法 GetBytes(DbDataReader, Boolean)
公共方法 GetBytes(DbDataReader, Int64, array<Byte[], Int32, Int32) 读取字节区块从列。当使用 ExecuteReader (CommandBehavior.SequentialAccess),您有效可以从 BLOB 列的流字节。
公共方法 GetDateTime(DbDataReader)
公共方法 GetDateTime(DbDataReader, DateTime)
公共方法 GetDateTimeOffset
公共方法 GetDouble(DbDataReader) 检索该列的值为二进制给定读取器。如果该列为空,则将引发异常。
公共方法 GetDouble(DbDataReader, Double) 检索该列的值为二进制给定阅读器
公共方法 GetFloat(DbDataReader) 检索该列的值作为浮点给定读取器。 如果该列为空,则将引发异常
公共方法 GetFloat(DbDataReader, Single) 检索该列的值作为浮点给定读取器。
公共方法 GetFloat(DbDataReader, Single, Single) 检索该列的值作为浮点给定读取器。
公共方法 GetGuid(DbDataReader)
公共方法 GetGuid(DbDataReader, Boolean) 检索该列的值作为 GUID 给定读取器。 如果 allowNulls 为 true,将返回空值为 null 的 GUID。 否则,因此,如果遇到 null,SQLException 会引发。
公共方法 GetGuid(DbDataReader, Boolean, Guid) 检索该列的值作为 GUID 给定读取器。 如果 allowNulls 为 true,将返回空值为 null 的 GUID。 否则,因此,如果遇到 null,SQLException 会引发。
公共方法 GetHashCode 作为默认哈希函数。 (继承自 Object。)
公共方法 GetInt16(DbDataReader) 检索该列的值作为 Int16 给定读取器。 异常在结果将引发异常,则列为空或不会找到。
公共方法 GetInt16(DbDataReader, Int16) 检索该列的值作为 Int16 给定读取器。 如果在结果未找到,则将引发异常。
公共方法 GetInt16(DbDataReader, Int16, Int16) 检索该列的值作为 Int16 给定读取器。
公共方法 GetInt32(DbDataReader) 检索该列的值作为 int 给定读取器。 如果该列为空,则将引发异常
公共方法 GetInt32(DbDataReader, Int32) 检索该列的值作为 int 给定读取器。
公共方法 GetInt32(DbDataReader, Int32, Int32) 检索该列的值作为 int 给定读取器。
公共方法 GetInt64(DbDataReader) 检索该列的值作为 int 给定读取器。 如果该列为空,则将引发异常
公共方法 GetInt64(DbDataReader, Int64) 检索该列的值作为 int 给定读取器。
公共方法 GetInt64(DbDataReader, Int64, Int64) 检索该列的值作为 int64 给定读取器。
公共方法 GetObject
公共方法 GetOrdinal
公共方法 GetString(DbDataReader, Boolean) 检索该列的值作为字符串给定读取器。 如果 allowNulls 为 true,将 null 值的形式返回空字符串。 否则,因此,如果遇到 null,SQLException 会引发。
公共方法 GetString(DbDataReader, String) 检索该列的值作为字符串给定读取器。 如果 DB 列为空,将返回。
公共方法 GetTimeSpan(SqlDataReader)
公共方法 GetTimeSpan(SqlDataReader, TimeSpan)
公共方法 GetTimeSpan(SqlDataReader, TimeSpan, TimeSpan)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 IsInitialized 返回值列是否解析到其序号值。
公共方法 IsNull
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)

页首

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参阅

参考

Microsoft.TeamFoundation.Framework.Server 命名空间