SqlChars 类

定义

SqlChars 是一个可变引用类型,可包装 Char 数组或 SqlString 实例。SqlChars is a mutable reference type that wraps a Char array or a SqlString instance.

public ref class SqlChars sealed : System::Data::SqlTypes::INullable, System::Runtime::Serialization::ISerializable, System::Xml::Serialization::IXmlSerializable
public ref class SqlChars sealed : System::Data::SqlTypes::INullable
public sealed class SqlChars : System.Data.SqlTypes.INullable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable
public sealed class SqlChars : System.Data.SqlTypes.INullable
[System.Serializable]
public sealed class SqlChars : System.Data.SqlTypes.INullable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable
type SqlChars = class
    interface INullable
    interface ISerializable
    interface IXmlSerializable
type SqlChars = class
    interface INullable
[<System.Serializable>]
type SqlChars = class
    interface INullable
    interface IXmlSerializable
    interface ISerializable
Public NotInheritable Class SqlChars
Implements INullable, ISerializable, IXmlSerializable
Public NotInheritable Class SqlChars
Implements INullable
继承
SqlChars
属性
实现

注解

SqlChars 可以为 varcharnvarchar 、、、 char nchar 和值获取,也可以 text ntext 通过非托管缓冲区来创建。SqlChars can be obtained for varchar, nvarchar, char, nchar, text, and ntext values, or can be created over an unmanaged buffer.

构造函数

SqlChars()

初始化 SqlChars 类的新实例。Initializes a new instance of the SqlChars class.

SqlChars(Char[])

根据指定的字符数组初始化 SqlChars 类的新实例。Initializes a new instance of the SqlChars class based on the specified character array.

SqlChars(SqlString)

根据指定的 SqlChars 值初始化 SqlString 类的新实例。Initializes a new instance of the SqlChars class based on the specified SqlString value.

属性

Buffer

返回一个对内部缓冲区的引用。Returns a reference to the internal buffer.

IsNull

获取一个布尔值,该值指示此 SqlChars 是否为 null。Gets a Boolean value that indicates whether this SqlChars is null.

Item[Int64]

获取或设置指定索引处的 SqlChars 实例。Gets or sets the SqlChars instance at the specified index.

Length

获取 SqlChars 实例中包含的值的长度。Gets the length of the value that is contained in the SqlChars instance.

MaxLength

获取内部缓冲区可保存的值的最大长度(以双字节字符为单位)。Gets the maximum length in two-byte characters of the value the internal buffer can hold.

Null

返回此 SqlChars 的 null 实例。Returns a null instance of this SqlChars.

Storage

返回有关此 SqlChars 实例的存储状态的信息。Returns information about the storage state of this SqlChars instance.

Value

返回此 SqlChars 保存的值的托管副本。Returns a managed copy of the value held by this SqlChars.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GetXsdType(XmlSchemaSet)

返回指定的 XmlSchemaSet 的 XML 架构定义语言 (XSD)。Returns the XML Schema definition language (XSD) of the specified XmlSchemaSet.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
Read(Int64, Char[], Int32, Int32)

将此 SqlChars 实例中的字符复制到传入缓冲区中,并返回复制的字符数。Copies characters from this SqlChars instance to the passed-in buffer and returns the number of copied characters.

SetLength(Int64)

设置此 SqlChars 实例的长度。Sets the length of this SqlChars instance.

SetNull()

将此 SqlChars 实例设置为 null。Sets this SqlChars instance to null.

ToSqlString()

将此 SqlChars 实例转换为其等效的 SqlString 表示形式。Converts this SqlChars instance to its equivalent SqlString representation.

ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
Write(Int64, Char[], Int32, Int32)

将传入缓冲区中的字符复制到此 SqlChars 实例中。Copies characters from the passed-in buffer to this SqlChars instance.

运算符

Explicit(SqlChars to SqlString)

SqlChars 结构转换为 SqlString 结构。Converts a SqlChars structure to a SqlString structure.

Explicit(SqlString to SqlChars)

SqlString 结构转换为 SqlChars 结构。Converts a SqlString structure to a SqlChars structure.

显式接口实现

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

获取序列化信息以及包含重新实例化此 SqlChars 实例所需的所有数据。Gets serialization information with all the data needed to reinstantiate this SqlChars instance.

IXmlSerializable.GetSchema()

此成员支持 .NET Framework 结构,不能在代码中直接使用。This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

IXmlSerializable.ReadXml(XmlReader)

此成员支持 .NET Framework 结构,不能在代码中直接使用。This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

IXmlSerializable.WriteXml(XmlWriter)

此成员支持 .NET Framework 结构,不能在代码中直接使用。This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

适用于

另请参阅