This topic has not yet been rated - Rate this topic

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.

Namespace:  System.Data.SqlTypes
Assembly:  System.Data (in System.Data.dll)
[SerializableAttribute]
public struct SqlString : INullable, IComparable, 
	IXmlSerializable

The SqlString type exposes the following members.

  Name Description
Public method Supported by the XNA Framework SqlString(String) Initializes a new instance of the SqlString structure using the specified string.
Public method Supported by the XNA Framework SqlString(String, Int32) Initializes a new instance of the SqlString structure using the specified string and locale id values.
Public method Supported by the XNA Framework SqlString(Int32, SqlCompareOptions, Byte[]) Initializes a new instance of the SqlString structure using the specified locale id, compare options, and data.
Public method Supported by the XNA Framework SqlString(String, Int32, SqlCompareOptions) Initializes a new instance of the SqlString structure using the specified string, locale id, and compare option values.
Public method Supported by the XNA Framework SqlString(Int32, SqlCompareOptions, Byte[], Boolean) Initializes a new instance of the SqlString class.
Public method Supported by the XNA Framework SqlString(Int32, SqlCompareOptions, Byte[], Int32, Int32) Initializes a new instance of the SqlString class.
Public method Supported by the XNA Framework SqlString(Int32, SqlCompareOptions, Byte[], Int32, Int32, Boolean) Initializes a new instance of the SqlString class.
Top
  Name Description
Public property Supported by the XNA Framework CompareInfo Gets the CompareInfo object that defines how string comparisons should be performed for this SqlString structure.
Public property Supported by the XNA Framework CultureInfo Gets the CultureInfo structure that represents information about the culture of this SqlString object.
Public property Supported by the XNA Framework IsNull Indicates whether this SqlString structure is null.
Public property Supported by the XNA Framework LCID Specifies the geographical locale and language for the SqlString structure.
Public property Supported by the XNA Framework 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.
Public property Supported by the XNA Framework Value Gets the string that is stored in this SqlString structure. This property is read-only.
Top
  Name Description
Public method Static member Supported by the XNA Framework Add Concatenates two specified SqlString values to create a new SqlString structure.
Public method Supported by the XNA Framework Clone Creates a copy of this SqlString object.
Public method Static member Supported by the XNA Framework CompareOptionsFromSqlCompareOptions Gets the CompareOptions enumeration equilvalent of the specified SqlCompareOptions value.
Public method Supported by the XNA Framework CompareTo(Object) Compares this SqlString object to the supplied Object and returns an indication of their relative values.
Public method Supported by the XNA Framework CompareTo(SqlString) Compares this SqlString instance to the supplied SqlString and returns an indication of their relative values.
Public method Static member Supported by the XNA Framework Concat Concatenates the two specified SqlString structures.
Public method Supported by the XNA Framework Equals(Object) Compares the supplied object parameter to the Value property of the SqlString object. (Overrides ValueType.Equals(Object).)
Public method Static member Supported by the XNA Framework Equals(SqlString, SqlString) Performs a logical comparison of the two SqlString operands to determine whether they are equal.
Protected method Supported by the XNA Framework Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method Supported by the XNA Framework GetHashCode Gets the hash code for this instance. (Overrides ValueType.GetHashCode().)
Public method Supported by the XNA Framework GetNonUnicodeBytes Gets an array of bytes, that contains the contents of the SqlString in ANSI format.
Public method Supported by the XNA Framework GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Supported by the XNA Framework GetUnicodeBytes Gets an array of bytes, that contains the contents of the SqlString in Unicode format.
Public method Static member Supported by the XNA Framework GetXsdType Returns the XML Schema definition language (XSD) of the specified XmlSchemaSet.
Public method Static member Supported by the XNA Framework GreaterThan Performs a logical comparison of the two SqlString operands to determine whether the first is greater than the second.
Public method Static member Supported by the XNA Framework GreaterThanOrEqual Performs a logical comparison of the two SqlString operands to determine whether the first is greater than or equal to the second.
Public method Static member Supported by the XNA Framework LessThan Performs a logical comparison of the two SqlString operands to determine whether the first is less than the second.
Public method Static member Supported by the XNA Framework LessThanOrEqual Performs a logical comparison of the two SqlString operands to determine whether the first is less than or equal to the second.
Protected method Supported by the XNA Framework MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Static member Supported by the XNA Framework NotEquals Performs a logical comparison of the two SqlString operands to determine whether they are not equal.
Public method Supported by the XNA Framework ToSqlBoolean Converts this SqlString structure to SqlBoolean.
Public method Supported by the XNA Framework ToSqlByte Converts this SqlString structure to SqlByte.
Public method Supported by the XNA Framework ToSqlDateTime Converts this SqlString structure to SqlDateTime.
Public method Supported by the XNA Framework ToSqlDecimal Converts this SqlString structure to SqlDecimal.
Public method Supported by the XNA Framework ToSqlDouble Converts this SqlString structure to SqlDouble.
Public method Supported by the XNA Framework ToSqlGuid Converts this SqlString structure to SqlGuid.
Public method Supported by the XNA Framework ToSqlInt16 Converts this SqlString structure to SqlInt16.
Public method Supported by the XNA Framework ToSqlInt32 Converts this SqlString structure to SqlInt32.
Public method Supported by the XNA Framework ToSqlInt64 Converts this SqlString structure to SqlInt64.
Public method Supported by the XNA Framework ToSqlMoney Converts this SqlString structure to SqlMoney.
Public method Supported by the XNA Framework ToSqlSingle Converts this SqlString structure to SqlSingle.
Public method Supported by the XNA Framework ToString Converts a SqlString object to a String. (Overrides ValueType.ToString().)
Top
  Name Description
Public operator Static member Supported by the XNA Framework Addition Concatenates the two specified SqlString structures.
Public operator Static member Supported by the XNA Framework Equality Performs a logical comparison of the two SqlString operands to determine whether they are equal.
Public operator Static member Supported by the XNA Framework Explicit(SqlBoolean to SqlString) Converts the specified SqlBoolean structure to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlByte to SqlString) Converts the specified SqlByte structure to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlDateTime to SqlString) Converts the specified SqlDateTime parameter to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlDecimal to SqlString) Converts the specified SqlDecimal parameter to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlDouble to SqlString) Converts the specified SqlDouble parameter to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlGuid to SqlString) Converts the specified SqlGuid parameter to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlInt16 to SqlString) Converts the specified SqlInt16 parameter to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlInt32 to SqlString) Converts the specified SqlInt32 parameter to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlInt64 to SqlString) Converts the specified SqlInt64 parameter to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlMoney to SqlString) Converts the specified SqlMoney parameter to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlSingle to SqlString) Converts the specified SqlSingle parameter to SqlString.
Public operator Static member Supported by the XNA Framework Explicit(SqlString to String) Converts a SqlString to a String
Public operator Static member Supported by the XNA Framework GreaterThan Performs a logical comparison of the two SqlString operands to determine whether the first is greater than the second.
Public operator Static member Supported by the XNA Framework GreaterThanOrEqual Performs a logical comparison of the two SqlString operands to determine whether the first is greater than or equal to the second.
Public operator Static member Supported by the XNA Framework Implicit(String to SqlString) Converts the String parameter to a SqlString.
Public operator Static member Supported by the XNA Framework Inequality Performs a logical comparison of the two SqlString operands to determine whether they are not equal.
Public operator Static member Supported by the XNA Framework LessThan Performs a logical comparison of the two SqlString operands to determine whether the first is less than the second.
Public operator Static member Supported by the XNA Framework LessThanOrEqual Performs a logical comparison of the two SqlString operands to determine whether the first is less than or equal to the second.
Top
  Name Description
Public field Static member Supported by the XNA Framework BinarySort Specifies that sorts should be based on a characters numeric value instead of its alphabetical value.
Public field Static member Supported by the XNA Framework BinarySort2 Specifies that sorts should be based on a character's numeric value instead of its alphabetical value.
Public field Static member Supported by the XNA Framework IgnoreCase Specifies that SqlString comparisons should ignore case.
Public field Static member Supported by the XNA Framework IgnoreKanaType Specifies that the string comparison must ignore the Kana type.
Public field Static member Supported by the XNA Framework IgnoreNonSpace Specifies that the string comparison must ignore non-space combining characters, such as diacritics.
Public field Static member Supported by the XNA Framework IgnoreWidth Specifies that the string comparison must ignore the character width.
Public field Static member Supported by the XNA Framework Null Represents a DBNull that can be assigned to this instance of the SqlString structure.
Top
  Name Description
Explicit interface implemetation Private method Supported by the XNA Framework IXmlSerializable.GetSchema This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Explicit interface implemetation Private method Supported by the XNA Framework IXmlSerializable.ReadXml This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Explicit interface implemetation Private method Supported by the XNA Framework IXmlSerializable.WriteXml This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Top

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ