This documentation is archived and is not being maintained.

SqlColumnBinder Class

This class is a convienent way to efficiently access result columns. It caches column ordinals.

To use this class, create a static instance of it, pass in the column name to the constructor, and use the GetXXX methods at runtime to retrieve the values.

After the first GetXXX() call, the column number will be cached.

This object should be reused for any future calls against the same shape of result set.

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

Namespace:  Microsoft.TeamFoundation.Framework.Server
Assembly:  Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)

public class SqlColumnBinder

The SqlColumnBinder type exposes the following members.

  NameDescription
Public methodSqlColumnBinderCreates a SqlColumnReader to read the named column
Top

  NameDescription
Public propertyColumnNameName of the column this binder binds too.
Top

  NameDescription
Public methodColumnExistsChecks if column is in the result set.
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetBoolean(DbDataReader)Retrieves the value of this column as a bool from the given reader. An exception will be thrown if the column is null
Public methodGetBoolean(DbDataReader, Boolean)Retrieves the value of this column as a bool from the given reader. An exception will be thrown if the column is null
Public methodGetBoolean(DbDataReader, Boolean, Boolean)Retrieves the value of this column as a bool from the given reader. Sets the output parameter to true if the value was null.
Public methodGetByte(DbDataReader)Retrieves the value of this column as an int from the given reader. An exception will be thrown if the column is null
Public methodGetByte(DbDataReader, Byte)Retrieves the value of this column as an int from the given reader. An exception will be thrown if the column is null
Public methodGetByte(DbDataReader, Byte, Byte)Retrieves the value of this column as an int from the given reader. An exception will be thrown if the column is null
Public methodGetBytes(DbDataReader, Boolean)
Public methodGetBytes(DbDataReader, Int64, Byte[], Int32, Int32)Read a chunk of bytes from a column. When used with ExecuteReader(CommandBehavior.SequentialAccess), you can efficiently stream bytes from a BLOB column.
Public methodGetDateTime(DbDataReader)
Public methodGetDateTime(DbDataReader, DateTime)
Public methodGetDateTimeOffset
Public methodGetDouble(DbDataReader)Retrieves the value of this column as a double from the given reader. An exception will be thrown if the column is null.
Public methodGetDouble(DbDataReader, Double)Retrieves the value of this column as a double from the given reader
Public methodGetFloat(DbDataReader)Retrieves the value of this column as float from the given reader. An exception will be thrown if the column is null
Public methodGetFloat(DbDataReader, Single)Retrieves the value of this column as float from the given reader.
Public methodGetFloat(DbDataReader, Single, Single)Retrieves the value of this column as float from the given reader.
Public methodGetGuid(DbDataReader)
Public methodGetGuid(DbDataReader, Boolean)Retrieves the value of this column as a Guid from the given reader. If allowNulls is true, null values will be returned as empty GUIDs. Otherwise, a SQLException will be thrown if a null is encountered
Public methodGetGuid(DbDataReader, Boolean, Guid)Retrieves the value of this column as a Guid from the given reader. If allowNulls is true, null values will be returned as empty GUIDs. Otherwise, a SQLException will be thrown if a null is encountered
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetInt16(DbDataReader)Retrieves the value of this column as an Int16 from the given reader. An exception will be thrown if the column is null or not found in the result set.
Public methodGetInt16(DbDataReader, Int16)Retrieves the value of this column as an Int16 from the given reader. An exception will be thrown if the is not found in the result set.
Public methodGetInt16(DbDataReader, Int16, Int16)Retrieves the value of this column as an Int16 from the given reader.
Public methodGetInt32(DbDataReader)Retrieves the value of this column as an int from the given reader. An exception will be thrown if the column is null
Public methodGetInt32(DbDataReader, Int32)Retrieves the value of this column as an int from the given reader.
Public methodGetInt32(DbDataReader, Int32, Int32)Retrieves the value of this column as an int from the given reader.
Public methodGetInt64(DbDataReader)Retrieves the value of this column as an int from the given reader. An exception will be thrown if the column is null
Public methodGetInt64(DbDataReader, Int64)Retrieves the value of this column as an int from the given reader.
Public methodGetInt64(DbDataReader, Int64, Int64)Retrieves the value of this column as an int64 from the given reader.
Public methodGetObject
Public methodGetOrdinal
Public methodGetString(DbDataReader, Boolean)Retrieves the value of this column as a string from the given reader. If allowNulls is true, null values will be returned as null strings. Otherwise, a SQLException will be thrown if a null is encountered
Public methodGetString(DbDataReader, String)Retrieves the value of this column as a string from the given reader. null will be returned if DB column is NULL.
Public methodGetTimeSpan(SqlDataReader)
Public methodGetTimeSpan(SqlDataReader, TimeSpan)
Public methodGetTimeSpan(SqlDataReader, TimeSpan, TimeSpan)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIsInitializedReturns value whether or not a column has been resolved to its ordinal value.
Public methodIsNull
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: