SqlString SqlString SqlString SqlString Struct

Definition

Represents a variable-length stream of characters to be stored in or retrieved from the database. 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
Inheritance
Attributes
Implements

Remarks

String always uses the default CultureInfo from the current thread, but SqlString contains its own locale Id and compare flags. The comparison result of two SqlString structures is independent of operating system and current thread locale.

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);  

Constructors

SqlString(String) SqlString(String) SqlString(String) SqlString(String)

Initializes a new instance of the SqlString structure using the specified string.

SqlString(String, Int32) SqlString(String, Int32) SqlString(String, Int32) SqlString(String, Int32)

Initializes a new instance of the SqlString structure using the specified string and locale id values.

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

Initializes a new instance of the SqlString structure using the specified locale id, compare options, and data.

SqlString(String, Int32, SqlCompareOptions) SqlString(String, Int32, SqlCompareOptions) SqlString(String, Int32, SqlCompareOptions) SqlString(String, Int32, SqlCompareOptions)

Initializes a new instance of the SqlString structure using the specified string, locale id, and compare option values.

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

Initializes a new instance of the SqlString class.

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

Initializes a new instance of the SqlString class.

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

Initializes a new instance of the SqlString class.

Fields

BinarySort BinarySort BinarySort BinarySort

Specifies that sorts should be based on a characters numeric value instead of its alphabetical value.

BinarySort2 BinarySort2 BinarySort2 BinarySort2

Specifies that sorts should be based on a character's numeric value instead of its alphabetical value.

IgnoreCase IgnoreCase IgnoreCase IgnoreCase

Specifies that SqlString comparisons should ignore case.

IgnoreKanaType IgnoreKanaType IgnoreKanaType IgnoreKanaType

Specifies that the string comparison must ignore the Kana type.

IgnoreNonSpace IgnoreNonSpace IgnoreNonSpace IgnoreNonSpace

Specifies that the string comparison must ignore non-space combining characters, such as diacritics.

IgnoreWidth IgnoreWidth IgnoreWidth IgnoreWidth

Specifies that the string comparison must ignore the character width.

Null Null Null Null

Represents a DBNull that can be assigned to this instance of the SqlString structure.

Properties

CompareInfo CompareInfo CompareInfo CompareInfo

Gets the CompareInfo object that defines how string comparisons should be performed for this SqlString structure.

CultureInfo CultureInfo CultureInfo CultureInfo

Gets the CultureInfo structure that represents information about the culture of this SqlString object.

IsNull IsNull IsNull IsNull

Indicates whether this SqlString structure is null.

LCID LCID LCID LCID

Specifies the geographical locale and language for the SqlString structure.

SqlCompareOptions SqlCompareOptions SqlCompareOptions SqlCompareOptions

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 Value Value Value

Gets the string that is stored in this SqlString structure. This property is read-only.

Methods

Add(SqlString, SqlString) Add(SqlString, SqlString) Add(SqlString, SqlString) Add(SqlString, SqlString)

Concatenates two specified SqlString values to create a new SqlString structure.

Clone() Clone() Clone() Clone()

Creates a copy of this SqlString object.

CompareOptionsFromSqlCompareOptions(SqlCompareOptions) CompareOptionsFromSqlCompareOptions(SqlCompareOptions) CompareOptionsFromSqlCompareOptions(SqlCompareOptions) CompareOptionsFromSqlCompareOptions(SqlCompareOptions)

Gets the CompareOptions enumeration equivalent of the specified SqlCompareOptions value.

CompareTo(SqlString) CompareTo(SqlString) CompareTo(SqlString) CompareTo(SqlString)

Compares this SqlString instance to the supplied SqlString and returns an indication of their relative values.

CompareTo(Object) CompareTo(Object) CompareTo(Object) CompareTo(Object)

Compares this SqlString object to the supplied Object and returns an indication of their relative values.

Concat(SqlString, SqlString) Concat(SqlString, SqlString) Concat(SqlString, SqlString) Concat(SqlString, SqlString)

Concatenates the two specified SqlString structures.

Equals(SqlString, SqlString) Equals(SqlString, SqlString) Equals(SqlString, SqlString) Equals(SqlString, SqlString)

Performs a logical comparison of the two SqlString operands to determine whether they are equal.

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

Compares the supplied object parameter to the Value property of the SqlString object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Gets the hash code for this instance.

GetNonUnicodeBytes() GetNonUnicodeBytes() GetNonUnicodeBytes() GetNonUnicodeBytes()

Gets an array of bytes, that contains the contents of the SqlString in ANSI format.

GetUnicodeBytes() GetUnicodeBytes() GetUnicodeBytes() GetUnicodeBytes()

Gets an array of bytes, that contains the contents of the SqlString in Unicode format.

GetXsdType(XmlSchemaSet) GetXsdType(XmlSchemaSet) GetXsdType(XmlSchemaSet) GetXsdType(XmlSchemaSet)

Returns the XML Schema definition language (XSD) of the specified XmlSchemaSet.

GreaterThan(SqlString, SqlString) GreaterThan(SqlString, SqlString) GreaterThan(SqlString, SqlString) GreaterThan(SqlString, SqlString)

Performs a logical comparison of the two SqlString operands to determine whether the first is greater than the second.

GreaterThanOrEqual(SqlString, SqlString) GreaterThanOrEqual(SqlString, SqlString) GreaterThanOrEqual(SqlString, SqlString) GreaterThanOrEqual(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) LessThan(SqlString, SqlString) LessThan(SqlString, SqlString) LessThan(SqlString, SqlString)

Performs a logical comparison of the two SqlString operands to determine whether the first is less than the second.

LessThanOrEqual(SqlString, SqlString) LessThanOrEqual(SqlString, SqlString) LessThanOrEqual(SqlString, SqlString) LessThanOrEqual(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) NotEquals(SqlString, SqlString) NotEquals(SqlString, SqlString) NotEquals(SqlString, SqlString)

Performs a logical comparison of the two SqlString operands to determine whether they are not equal.

ToSqlBoolean() ToSqlBoolean() ToSqlBoolean() ToSqlBoolean()

Converts this SqlString structure to SqlBoolean.

ToSqlByte() ToSqlByte() ToSqlByte() ToSqlByte()

Converts this SqlString structure to SqlByte.

ToSqlDateTime() ToSqlDateTime() ToSqlDateTime() ToSqlDateTime()

Converts this SqlString structure to SqlDateTime.

ToSqlDecimal() ToSqlDecimal() ToSqlDecimal() ToSqlDecimal()

Converts this SqlString structure to SqlDecimal.

ToSqlDouble() ToSqlDouble() ToSqlDouble() ToSqlDouble()

Converts this SqlString structure to SqlDouble.

ToSqlGuid() ToSqlGuid() ToSqlGuid() ToSqlGuid()

Converts this SqlString structure to SqlGuid.

ToSqlInt16() ToSqlInt16() ToSqlInt16() ToSqlInt16()

Converts this SqlString structure to SqlInt16.

ToSqlInt32() ToSqlInt32() ToSqlInt32() ToSqlInt32()

Converts this SqlString structure to SqlInt32.

ToSqlInt64() ToSqlInt64() ToSqlInt64() ToSqlInt64()

Converts this SqlString structure to SqlInt64.

ToSqlMoney() ToSqlMoney() ToSqlMoney() ToSqlMoney()

Converts this SqlString structure to SqlMoney.

ToSqlSingle() ToSqlSingle() ToSqlSingle() ToSqlSingle()

Converts this SqlString structure to SqlSingle.

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

Converts a SqlString object to a String.

Operators

Addition(SqlString, SqlString) Addition(SqlString, SqlString) Addition(SqlString, SqlString) Addition(SqlString, SqlString)

Concatenates the two specified SqlString structures.

Equality(SqlString, SqlString) Equality(SqlString, SqlString) Equality(SqlString, SqlString) Equality(SqlString, SqlString)

Performs a logical comparison of the two SqlString operands to determine whether they are equal.

Explicit(SqlString to String) Explicit(SqlString to String) Explicit(SqlString to String) Explicit(SqlString to String)

Converts a SqlString to a String

Explicit(SqlSingle to SqlString) Explicit(SqlSingle to SqlString) Explicit(SqlSingle to SqlString) Explicit(SqlSingle to SqlString)

Converts the specified SqlSingle parameter to SqlString.

Explicit(SqlMoney to SqlString) Explicit(SqlMoney to SqlString) Explicit(SqlMoney to SqlString) Explicit(SqlMoney to SqlString)

Converts the specified SqlMoney parameter to SqlString.

Explicit(SqlInt64 to SqlString) Explicit(SqlInt64 to SqlString) Explicit(SqlInt64 to SqlString) Explicit(SqlInt64 to SqlString)

Converts the specified SqlInt64 parameter to SqlString.

Explicit(SqlInt16 to SqlString) Explicit(SqlInt16 to SqlString) Explicit(SqlInt16 to SqlString) Explicit(SqlInt16 to SqlString)

Converts the specified SqlInt16 parameter to SqlString.

Explicit(SqlInt32 to SqlString) Explicit(SqlInt32 to SqlString) Explicit(SqlInt32 to SqlString) Explicit(SqlInt32 to SqlString)

Converts the specified SqlInt32 parameter to SqlString.

Explicit(SqlDouble to SqlString) Explicit(SqlDouble to SqlString) Explicit(SqlDouble to SqlString) Explicit(SqlDouble to SqlString)

Converts the specified SqlDouble parameter to SqlString.

Explicit(SqlDecimal to SqlString) Explicit(SqlDecimal to SqlString) Explicit(SqlDecimal to SqlString) Explicit(SqlDecimal to SqlString)

Converts the specified SqlDecimal parameter to SqlString.

Explicit(SqlDateTime to SqlString) Explicit(SqlDateTime to SqlString) Explicit(SqlDateTime to SqlString) Explicit(SqlDateTime to SqlString)

Converts the specified SqlDateTime parameter to SqlString.

Explicit(SqlByte to SqlString) Explicit(SqlByte to SqlString) Explicit(SqlByte to SqlString) Explicit(SqlByte to SqlString)

Converts the specified SqlByte structure to SqlString.

Explicit(SqlBoolean to SqlString) Explicit(SqlBoolean to SqlString) Explicit(SqlBoolean to SqlString) Explicit(SqlBoolean to SqlString)

Converts the specified SqlBoolean structure to SqlString.

Explicit(SqlGuid to SqlString) Explicit(SqlGuid to SqlString) Explicit(SqlGuid to SqlString) Explicit(SqlGuid to SqlString)

Converts the specified SqlGuid parameter to SqlString.

GreaterThan(SqlString, SqlString) GreaterThan(SqlString, SqlString) GreaterThan(SqlString, SqlString) GreaterThan(SqlString, SqlString)

Performs a logical comparison of the two SqlString operands to determine whether the first is greater than the second.

GreaterThanOrEqual(SqlString, SqlString) GreaterThanOrEqual(SqlString, SqlString) GreaterThanOrEqual(SqlString, SqlString) GreaterThanOrEqual(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) Implicit(String to SqlString) Implicit(String to SqlString) Implicit(String to SqlString)

Converts the String parameter to a SqlString.

Inequality(SqlString, SqlString) Inequality(SqlString, SqlString) Inequality(SqlString, SqlString) Inequality(SqlString, SqlString)

Performs a logical comparison of the two SqlString operands to determine whether they are not equal.

LessThan(SqlString, SqlString) LessThan(SqlString, SqlString) LessThan(SqlString, SqlString) LessThan(SqlString, SqlString)

Performs a logical comparison of the two SqlString operands to determine whether the first is less than the second.

LessThanOrEqual(SqlString, SqlString) LessThanOrEqual(SqlString, SqlString) LessThanOrEqual(SqlString, SqlString) LessThanOrEqual(SqlString, SqlString)

Performs a logical comparison of the two SqlString operands to determine whether the first is less than or equal to the second.

Explicit Interface Implementations

IXmlSerializable.GetSchema() IXmlSerializable.GetSchema() IXmlSerializable.GetSchema() IXmlSerializable.GetSchema()

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)

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)

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Applies to

See also