SqlString 结构

定义

表示要存储在数据库中或从数据库中检索的字符的可变长度流。Represents a variable-length stream of characters to be stored in or retrieved from the database. SqlString 具有与其相应的 .NET Framework String 数据类型不同的基础数据结构。SqlString has a different underlying data structure from its corresponding .NET Framework String data type.

public value class SqlString : IComparable, System::Data::SqlTypes::INullable, System::Xml::Serialization::IXmlSerializable
[System.Serializable]
public struct SqlString : IComparable, System.Data.SqlTypes.INullable, System.Xml.Serialization.IXmlSerializable
type SqlString = struct
    interface INullable
    interface IXmlSerializable
Public Structure SqlString
Implements IComparable, INullable, IXmlSerializable
继承
SqlString
属性
实现

注解

String始终使用当前线程CultureInfo中的默认值, 但SqlString包含其自己的区域设置 Id 和比较标志。String always uses the default CultureInfo from the current thread, but SqlString contains its own locale Id and compare flags. 两个SqlString结构的比较结果独立于操作系统和当前线程区域设置。The comparison result of two SqlString structures is independent of operating system and current thread locale.

使用SqlString比较运算符时, 请注意, 如果参数的 lcid 不同, 比较函数将引发异常, 因为它们不能进行比较。When you use SqlString comparison operators, note that if the LCIDs of arguments are different, comparison functions throw an exception because they cannot be compared. 例如, 语句For example, the statement

SqlString mySqlString = new SqlString("abc");  

等效于is equivalent to

SqlString mySqlString = new SqlString("abc", CultureInfo.CurrentCulture.LCID);  

构造函数

SqlString(Int32, SqlCompareOptions, Byte[])

使用指定的区域设置 ID、比较选项和数据,初始化 SqlString 结构的新实例。Initializes a new instance of the SqlString structure using the specified locale id, compare options, and data.

SqlString(Int32, SqlCompareOptions, Byte[], Boolean)

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

SqlString(Int32, SqlCompareOptions, Byte[], Int32, Int32)

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

SqlString(Int32, SqlCompareOptions, Byte[], Int32, Int32, Boolean)

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

SqlString(String)

使用指定的字符串初始化 SqlString 结构的新实例。Initializes a new instance of the SqlString structure using the specified string.

SqlString(String, Int32)

使用指定的字符串和区域设置 ID 值,初始化 SqlString 结构的新实例。Initializes a new instance of the SqlString structure using the specified string and locale id values.

SqlString(String, Int32, SqlCompareOptions)

使用指定字符串、区域设置 ID 和比较选项值,初始化 SqlString 结构的新实例。Initializes a new instance of the SqlString structure using the specified string, locale id, and compare option values.

字段

BinarySort

指定排序应基于字符数值(而非其字母值)。Specifies that sorts should be based on a characters numeric value instead of its alphabetical value.

BinarySort2

指定排序应基于字符数值(而非其字母值)。Specifies that sorts should be based on a character's numeric value instead of its alphabetical value.

IgnoreCase

指定 SqlString 比较应忽略大小写。Specifies that SqlString comparisons should ignore case.

IgnoreKanaType

指定字符串比较必须忽略假名类型。Specifies that the string comparison must ignore the Kana type.

IgnoreNonSpace

指定字符串比较必须忽略非空格组合字符,比如音调符号。Specifies that the string comparison must ignore non-space combining characters, such as diacritics.

IgnoreWidth

指定字符串比较必须忽略字符宽度。Specifies that the string comparison must ignore the character width.

Null

表示可指派给 DBNull 结构的此实例的 SqlStringRepresents a DBNull that can be assigned to this instance of the SqlString structure.

属性

CompareInfo

获取 CompareInfo 对象,该对象定义如何对此 SqlString 结构执行字符串比较。Gets the CompareInfo object that defines how string comparisons should be performed for this SqlString structure.

CultureInfo

获取 CultureInfo 结构,它表示有关此 SqlString 对象的区域性信息。Gets the CultureInfo structure that represents information about the culture of this SqlString object.

IsNull

指示此 SqlString 结构是否为 null。Indicates whether this SqlString structure is null.

LCID

指定 SqlString 结构的地理区域设置和语言。Specifies the geographical locale and language for the SqlString structure.

SqlCompareOptions

一个或多个 SqlCompareOptions 枚举值的组合,它们表示此 SqlString 与其他 SqlString 结构的比较方式。A combination of one or more of the SqlCompareOptions enumeration values that represent the way in which this SqlString should be compared to other SqlString structures.

Value

获取存储在此 SqlString 结构中的字符串。Gets the string that is stored in this SqlString structure. 此属性是只读的。This property is read-only.

方法

Add(SqlString, SqlString)

串联两个指定的 SqlString 值以创建一个新的 SqlString 结构。Concatenates two specified SqlString values to create a new SqlString structure.

Clone()

创建此 SqlString 对象的一个副本。Creates a copy of this SqlString object.

CompareOptionsFromSqlCompareOptions(SqlCompareOptions)

获取与指定 CompareOptions 值等效的 SqlCompareOptions 枚举。Gets the CompareOptions enumeration equivalent of the specified SqlCompareOptions value.

CompareTo(Object)

将此 SqlString 对象与所提供的 Object 进行比较,并返回其相对值的指示值。Compares this SqlString object to the supplied Object and returns an indication of their relative values.

CompareTo(SqlString)

将此 SqlString 实例与所提供的 SqlString 进行比较,并返回二者相对值的指示值。Compares this SqlString instance to the supplied SqlString and returns an indication of their relative values.

Concat(SqlString, SqlString)

串连两个指定的 SqlString 结构。Concatenates the two specified SqlString structures.

Equals(Object)

将提供的对象参数与 Value 对象的 SqlString 属性进行比较。Compares the supplied object parameter to the Value property of the SqlString object.

Equals(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定它们是否相等。Performs a logical comparison of the two SqlString operands to determine whether they are equal.

GetHashCode()

获取此实例的哈希代码。Gets the hash code for this instance.

GetNonUnicodeBytes()

获取字节的数组,其中包含 SqlString ANSI 格式的内容。Gets an array of bytes, that contains the contents of the SqlString in ANSI format.

GetUnicodeBytes()

获取字节的数组,其中包含 SqlString Unicode 格式的内容。Gets an array of bytes, that contains the contents of the SqlString in Unicode format.

GetXsdType(XmlSchemaSet)

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

GreaterThan(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定第一个操作数是否大于第二个操作数。Performs a logical comparison of the two SqlString operands to determine whether the first is greater than the second.

GreaterThanOrEqual(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定第一个操作数是否大于或等于第二个操作数。Performs a logical comparison of the two SqlString operands to determine whether the first is greater than or equal to the second.

LessThan(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定第一个操作数是否小于第二个操作数。Performs a logical comparison of the two SqlString operands to determine whether the first is less than the second.

LessThanOrEqual(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定第一个操作数是否小于或等于第二个操作数。Performs a logical comparison of the two SqlString operands to determine whether the first is less than or equal to the second.

NotEquals(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定它们是否不相等。Performs a logical comparison of the two SqlString operands to determine whether they are not equal.

ToSqlBoolean()

将此 SqlString 结构转换为 SqlBooleanConverts this SqlString structure to SqlBoolean.

ToSqlByte()

将此 SqlString 结构转换为 SqlByteConverts this SqlString structure to SqlByte.

ToSqlDateTime()

将此 SqlString 结构转换为 SqlDateTimeConverts this SqlString structure to SqlDateTime.

ToSqlDecimal()

将此 SqlString 结构转换为 SqlDecimalConverts this SqlString structure to SqlDecimal.

ToSqlDouble()

将此 SqlString 结构转换为 SqlDoubleConverts this SqlString structure to SqlDouble.

ToSqlGuid()

将此 SqlString 结构转换为 SqlGuidConverts this SqlString structure to SqlGuid.

ToSqlInt16()

将此 SqlString 结构转换为 SqlInt16Converts this SqlString structure to SqlInt16.

ToSqlInt32()

将此 SqlString 结构转换为 SqlInt32Converts this SqlString structure to SqlInt32.

ToSqlInt64()

将此 SqlString 结构转换为 SqlInt64Converts this SqlString structure to SqlInt64.

ToSqlMoney()

将此 SqlString 结构转换为 SqlMoneyConverts this SqlString structure to SqlMoney.

ToSqlSingle()

将此 SqlString 结构转换为 SqlSingleConverts this SqlString structure to SqlSingle.

ToString()

SqlString 对象转换为 StringConverts a SqlString object to a String.

操作员

Addition(SqlString, SqlString)

串连两个指定的 SqlString 结构。Concatenates the two specified SqlString structures.

Equality(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定它们是否相等。Performs a logical comparison of the two SqlString operands to determine whether they are equal.

Explicit(SqlBoolean to SqlString)

将指定的 SqlBoolean 结构转换为 SqlStringConverts the specified SqlBoolean structure to SqlString.

Explicit(SqlByte to SqlString)

将指定的 SqlByte 结构转换为 SqlStringConverts the specified SqlByte structure to SqlString.

Explicit(SqlDateTime to SqlString)

将指定的 SqlDateTime 参数转换为 SqlStringConverts the specified SqlDateTime parameter to SqlString.

Explicit(SqlDecimal to SqlString)

将指定的 SqlDecimal 参数转换为 SqlStringConverts the specified SqlDecimal parameter to SqlString.

Explicit(SqlDouble to SqlString)

将指定的 SqlDouble 参数转换为 SqlStringConverts the specified SqlDouble parameter to SqlString.

Explicit(SqlGuid to SqlString)

将指定的 SqlGuid 参数转换为 SqlStringConverts the specified SqlGuid parameter to SqlString.

Explicit(SqlInt16 to SqlString)

将指定的 SqlInt16 参数转换为 SqlStringConverts the specified SqlInt16 parameter to SqlString.

Explicit(SqlInt32 to SqlString)

将指定的 SqlInt32 参数转换为 SqlStringConverts the specified SqlInt32 parameter to SqlString.

Explicit(SqlInt64 to SqlString)

将指定的 SqlInt64 参数转换为 SqlStringConverts the specified SqlInt64 parameter to SqlString.

Explicit(SqlMoney to SqlString)

将指定的 SqlMoney 参数转换为 SqlStringConverts the specified SqlMoney parameter to SqlString.

Explicit(SqlSingle to SqlString)

将指定的 SqlSingle 参数转换为 SqlStringConverts the specified SqlSingle parameter to SqlString.

Explicit(SqlString to String)

SqlString 转换为 StringConverts a SqlString to a String

GreaterThan(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定第一个操作数是否大于第二个操作数。Performs a logical comparison of the two SqlString operands to determine whether the first is greater than the second.

GreaterThanOrEqual(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定第一个操作数是否大于或等于第二个操作数。Performs a logical comparison of the two SqlString operands to determine whether the first is greater than or equal to the second.

Implicit(String to SqlString)

String 参数转换为 SqlStringConverts the String parameter to a SqlString.

Inequality(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定它们是否不相等。Performs a logical comparison of the two SqlString operands to determine whether they are not equal.

LessThan(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定第一个操作数是否小于第二个操作数。Performs a logical comparison of the two SqlString operands to determine whether the first is less than the second.

LessThanOrEqual(SqlString, SqlString)

对两个 SqlString 操作数执行逻辑比较,以确定第一个操作数是否小于或等于第二个操作数。Performs a logical comparison of the two SqlString operands to determine whether the first is less than or equal to the second.

显式界面实现

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.

适用于

另请参阅