SqlString Structure
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.
Assembly: System.Data (in System.Data.dll)
The SqlString type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | SqlString(String) | Initializes a new instance of the SqlString structure using the specified string. |
![]() ![]() | SqlString(String, Int32) | Initializes a new instance of the SqlString structure using the specified string and locale id values. |
![]() ![]() | SqlString(Int32, SqlCompareOptions, array<Byte>) | Initializes a new instance of the SqlString structure using the specified locale id, compare options, and data. |
![]() ![]() | 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, array<Byte>, Boolean) | Initializes a new instance of the SqlString class. |
![]() ![]() | SqlString(Int32, SqlCompareOptions, array<Byte>, Int32, Int32) | Initializes a new instance of the SqlString class. |
![]() ![]() | SqlString(Int32, SqlCompareOptions, array<Byte>, Int32, Int32, Boolean) | Initializes a new instance of the SqlString class. |
| Name | Description | |
|---|---|---|
![]() ![]() | CompareInfo | Gets the CompareInfo object that defines how string comparisons should be performed for this SqlString structure. |
![]() ![]() | CultureInfo | Gets the CultureInfo structure that represents information about the culture of this SqlString object. |
![]() ![]() | IsNull | Indicates whether this SqlString structure is null. |
![]() ![]() | LCID | Specifies the geographical locale and language for the SqlString structure. |
![]() ![]() | 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 | Gets the string that is stored in this SqlString structure. This property is read-only. |
| Name | Description | |
|---|---|---|
![]() ![]() ![]() | Add | Concatenates two specified SqlString values to create a new SqlString structure. |
![]() ![]() | Clone | Creates a copy of this SqlString object. |
![]() ![]() ![]() | CompareOptionsFromSqlCompareOptions | Gets the CompareOptions enumeration equilvalent of the specified SqlCompareOptions value. |
![]() ![]() | CompareTo(Object) | Compares this SqlString object to the supplied Object and returns an indication of their relative values. |
![]() ![]() | CompareTo(SqlString) | Compares this SqlString instance to the supplied SqlString and returns an indication of their relative values. |
![]() ![]() ![]() | Concat | Concatenates the two specified SqlString structures. |
![]() ![]() | Equals(Object) | Compares the supplied object parameter to the Value property of the SqlString object. (Overrides ValueType::Equals(Object).) |
![]() ![]() ![]() | Equals(SqlString, SqlString) | Performs a logical comparison of the two SqlString operands to determine whether they are equal. |
![]() ![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() ![]() | GetHashCode | Gets the hash code for this instance. (Overrides ValueType::GetHashCode().) |
![]() ![]() | GetNonUnicodeBytes | Gets an array of bytes, that contains the contents of the SqlString in ANSI format. |
![]() ![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | GetUnicodeBytes | Gets an array of bytes, that contains the contents of the SqlString in Unicode format. |
![]() ![]() ![]() | GetXsdType | Returns the XML Schema definition language (XSD) of the specified XmlSchemaSet. |
![]() ![]() ![]() | GreaterThan | Performs a logical comparison of the two SqlString operands to determine whether the first is greater than the second. |
![]() ![]() ![]() | GreaterThanOrEqual | Performs a logical comparison of the two SqlString operands to determine whether the first is greater than or equal to the second. |
![]() ![]() ![]() | LessThan | Performs a logical comparison of the two SqlString operands to determine whether the first is less than the second. |
![]() ![]() ![]() | LessThanOrEqual | Performs a logical comparison of the two SqlString operands to determine whether the first is less than or equal to the second. |
![]() ![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() ![]() ![]() | NotEquals | Performs a logical comparison of the two SqlString operands to determine whether they are not equal. |
![]() ![]() | ToSqlBoolean | Converts this SqlString structure to SqlBoolean. |
![]() ![]() | ToSqlByte | Converts this SqlString structure to SqlByte. |
![]() ![]() | ToSqlDateTime | Converts this SqlString structure to SqlDateTime. |
![]() ![]() | ToSqlDecimal | Converts this SqlString structure to SqlDecimal. |
![]() ![]() | ToSqlDouble | Converts this SqlString structure to SqlDouble. |
![]() ![]() | ToSqlGuid | Converts this SqlString structure to SqlGuid. |
![]() ![]() | ToSqlInt16 | Converts this SqlString structure to SqlInt16. |
![]() ![]() | ToSqlInt32 | Converts this SqlString structure to SqlInt32. |
![]() ![]() | ToSqlInt64 | Converts this SqlString structure to SqlInt64. |
![]() ![]() | ToSqlMoney | Converts this SqlString structure to SqlMoney. |
![]() ![]() | ToSqlSingle | Converts this SqlString structure to SqlSingle. |
![]() ![]() | ToString | Converts a SqlString object to a String. (Overrides ValueType::ToString().) |
| Name | Description | |
|---|---|---|
![]() ![]() ![]() | Addition | Concatenates the two specified SqlString structures. |
![]() ![]() ![]() | Equality | Performs a logical comparison of the two SqlString operands to determine whether they are equal. |
![]() ![]() ![]() | Explicit(SqlBoolean to SqlString) | Converts the specified SqlBoolean structure to SqlString. |
![]() ![]() ![]() | Explicit(SqlByte to SqlString) | Converts the specified SqlByte structure to SqlString. |
![]() ![]() ![]() | Explicit(SqlDateTime to SqlString) | Converts the specified SqlDateTime parameter to SqlString. |
![]() ![]() ![]() | Explicit(SqlDecimal to SqlString) | Converts the specified SqlDecimal parameter to SqlString. |
![]() ![]() ![]() | Explicit(SqlDouble to SqlString) | Converts the specified SqlDouble parameter to SqlString. |
![]() ![]() ![]() | Explicit(SqlGuid to SqlString) | Converts the specified SqlGuid parameter to SqlString. |
![]() ![]() ![]() | Explicit(SqlInt16 to SqlString) | Converts the specified SqlInt16 parameter to SqlString. |
![]() ![]() ![]() | Explicit(SqlInt32 to SqlString) | Converts the specified SqlInt32 parameter to SqlString. |
![]() ![]() ![]() | Explicit(SqlInt64 to SqlString) | Converts the specified SqlInt64 parameter to SqlString. |
![]() ![]() ![]() | Explicit(SqlMoney to SqlString) | Converts the specified SqlMoney parameter to SqlString. |
![]() ![]() ![]() | Explicit(SqlSingle to SqlString) | Converts the specified SqlSingle parameter to SqlString. |
![]() ![]() ![]() | Explicit(SqlString to String) | Converts a SqlString to a String |
![]() ![]() ![]() | GreaterThan | Performs a logical comparison of the two SqlString operands to determine whether the first is greater than the second. |
![]() ![]() ![]() | GreaterThanOrEqual | 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) | Converts the String parameter to a SqlString. |
![]() ![]() ![]() | Inequality | Performs a logical comparison of the two SqlString operands to determine whether they are not equal. |
![]() ![]() ![]() | LessThan | Performs a logical comparison of the two SqlString operands to determine whether the first is less than the second. |
![]() ![]() ![]() | LessThanOrEqual | Performs a logical comparison of the two SqlString operands to determine whether the first is less than or equal to the second. |
| Name | Description | |
|---|---|---|
![]() ![]() ![]() | 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 | 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 | Represents a DBNull that can be assigned to this instance of the SqlString structure. |
| Name | Description | |
|---|---|---|
![]() ![]() ![]() | IXmlSerializable::GetSchema | This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. |
![]() ![]() ![]() | IXmlSerializable::ReadXml | This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. |
![]() ![]() ![]() | IXmlSerializable::WriteXml | This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. |
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);
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
