SqlChars SqlChars SqlChars SqlChars Class

定义

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

注解

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

构造函数

SqlChars() SqlChars() SqlChars() SqlChars()

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

SqlChars(Char[]) SqlChars(Char[]) SqlChars(Char[]) SqlChars(Char[])

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

SqlChars(SqlString) SqlChars(SqlString) SqlChars(SqlString) SqlChars(SqlString)

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

属性

Buffer Buffer Buffer Buffer

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

IsNull IsNull IsNull IsNull

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

Item[Int64] Item[Int64] Item[Int64] Item[Int64]

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

Length Length Length Length

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

MaxLength MaxLength MaxLength MaxLength

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

Null Null Null Null

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

Storage Storage Storage Storage

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

Value Value Value Value

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

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
GetXsdType(XmlSchemaSet) GetXsdType(XmlSchemaSet) GetXsdType(XmlSchemaSet) GetXsdType(XmlSchemaSet)

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

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
Read(Int64, Char[], Int32, Int32) Read(Int64, Char[], Int32, Int32) Read(Int64, Char[], Int32, Int32) 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) SetLength(Int64) SetLength(Int64) SetLength(Int64)

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

SetNull() SetNull() SetNull() SetNull()

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

ToSqlString() ToSqlString() ToSqlString() ToSqlString()

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

ToString() ToString() ToString() ToString()

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

(Inherited from Object)
Write(Int64, Char[], Int32, Int32) Write(Int64, Char[], Int32, Int32) Write(Int64, Char[], Int32, Int32) Write(Int64, Char[], Int32, Int32)

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

操作员

Explicit(SqlChars to SqlString) Explicit(SqlChars to SqlString) Explicit(SqlChars to SqlString) Explicit(SqlChars to SqlString)

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

Explicit(SqlString to SqlChars) Explicit(SqlString to SqlChars) Explicit(SqlString to SqlChars) Explicit(SqlString to SqlChars)

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

显式界面实现

ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext)

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

IXmlSerializable.GetSchema() IXmlSerializable.GetSchema() IXmlSerializable.GetSchema() 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) IXmlSerializable.ReadXml(XmlReader) IXmlSerializable.ReadXml(XmlReader) 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) IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter) IXmlSerializable.WriteXml(XmlWriter)

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

适用于

另请参阅