Export (0) Print
Expand All

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 value class SqlString : INullable, 
	IComparable, IXmlSerializable

The SqlString type exposes the following members.

  NameDescription
Public methodSupported by the XNA FrameworkSqlString(String)Initializes a new instance of the SqlString structure using the specified string.
Public methodSupported by the XNA FrameworkSqlString(String, Int32)Initializes a new instance of the SqlString structure using the specified string and locale id values.
Public methodSupported by the XNA FrameworkSqlString(Int32, SqlCompareOptions, array<Byte>)Initializes a new instance of the SqlString structure using the specified locale id, compare options, and data.
Public methodSupported by the XNA FrameworkSqlString(String, Int32, SqlCompareOptions)Initializes a new instance of the SqlString structure using the specified string, locale id, and compare option values.
Public methodSupported by the XNA FrameworkSqlString(Int32, SqlCompareOptions, array<Byte>, Boolean)Initializes a new instance of the SqlString class.
Public methodSupported by the XNA FrameworkSqlString(Int32, SqlCompareOptions, array<Byte>, Int32, Int32)Initializes a new instance of the SqlString class.
Public methodSupported by the XNA FrameworkSqlString(Int32, SqlCompareOptions, array<Byte>, Int32, Int32, Boolean)Initializes a new instance of the SqlString class.
Top

  NameDescription
Public propertySupported by the XNA FrameworkCompareInfoGets the CompareInfo object that defines how string comparisons should be performed for this SqlString structure.
Public propertySupported by the XNA FrameworkCultureInfoGets the CultureInfo structure that represents information about the culture of this SqlString object.
Public propertySupported by the XNA FrameworkIsNullIndicates whether this SqlString structure is null.
Public propertySupported by the XNA FrameworkLCIDSpecifies the geographical locale and language for the SqlString structure.
Public propertySupported by the XNA FrameworkSqlCompareOptionsA 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 propertySupported by the XNA FrameworkValueGets the string that is stored in this SqlString structure. This property is read-only.
Top

  NameDescription
Public methodStatic memberSupported by the XNA FrameworkAddConcatenates two specified SqlString values to create a new SqlString structure.
Public methodSupported by the XNA FrameworkCloneCreates a copy of this SqlString object.
Public methodStatic memberSupported by the XNA FrameworkCompareOptionsFromSqlCompareOptionsGets the CompareOptions enumeration equilvalent of the specified SqlCompareOptions value.
Public methodSupported by the XNA FrameworkCompareTo(Object)Compares this SqlString object to the supplied Object and returns an indication of their relative values.
Public methodSupported by the XNA FrameworkCompareTo(SqlString)Compares this SqlString instance to the supplied SqlString and returns an indication of their relative values.
Public methodStatic memberSupported by the XNA FrameworkConcatConcatenates the two specified SqlString structures.
Public methodSupported by the XNA FrameworkEquals(Object)Compares the supplied object parameter to the Value property of the SqlString object. (Overrides ValueType::Equals(Object).)
Public methodStatic memberSupported by the XNA FrameworkEquals(SqlString, SqlString)Performs a logical comparison of the two SqlString operands to determine whether they are equal.
Protected methodSupported by the XNA FrameworkFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by the XNA FrameworkGetHashCodeGets the hash code for this instance. (Overrides ValueType::GetHashCode().)
Public methodSupported by the XNA FrameworkGetNonUnicodeBytesGets an array of bytes, that contains the contents of the SqlString in ANSI format.
Public methodSupported by the XNA FrameworkGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by the XNA FrameworkGetUnicodeBytesGets an array of bytes, that contains the contents of the SqlString in Unicode format.
Public methodStatic memberSupported by the XNA FrameworkGetXsdTypeReturns the XML Schema definition language (XSD) of the specified XmlSchemaSet.
Public methodStatic memberSupported by the XNA FrameworkGreaterThanPerforms a logical comparison of the two SqlString operands to determine whether the first is greater than the second.
Public methodStatic memberSupported by the XNA FrameworkGreaterThanOrEqualPerforms a logical comparison of the two SqlString operands to determine whether the first is greater than or equal to the second.
Public methodStatic memberSupported by the XNA FrameworkLessThanPerforms a logical comparison of the two SqlString operands to determine whether the first is less than the second.
Public methodStatic memberSupported by the XNA FrameworkLessThanOrEqualPerforms a logical comparison of the two SqlString operands to determine whether the first is less than or equal to the second.
Protected methodSupported by the XNA FrameworkMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberSupported by the XNA FrameworkNotEqualsPerforms a logical comparison of the two SqlString operands to determine whether they are not equal.
Public methodSupported by the XNA FrameworkToSqlBooleanConverts this SqlString structure to SqlBoolean.
Public methodSupported by the XNA FrameworkToSqlByteConverts this SqlString structure to SqlByte.
Public methodSupported by the XNA FrameworkToSqlDateTimeConverts this SqlString structure to SqlDateTime.
Public methodSupported by the XNA FrameworkToSqlDecimalConverts this SqlString structure to SqlDecimal.
Public methodSupported by the XNA FrameworkToSqlDoubleConverts this SqlString structure to SqlDouble.
Public methodSupported by the XNA FrameworkToSqlGuidConverts this SqlString structure to SqlGuid.
Public methodSupported by the XNA FrameworkToSqlInt16Converts this SqlString structure to SqlInt16.
Public methodSupported by the XNA FrameworkToSqlInt32Converts this SqlString structure to SqlInt32.
Public methodSupported by the XNA FrameworkToSqlInt64Converts this SqlString structure to SqlInt64.
Public methodSupported by the XNA FrameworkToSqlMoneyConverts this SqlString structure to SqlMoney.
Public methodSupported by the XNA FrameworkToSqlSingleConverts this SqlString structure to SqlSingle.
Public methodSupported by the XNA FrameworkToStringConverts a SqlString object to a String. (Overrides ValueType::ToString().)
Top

  NameDescription
Public operatorStatic memberSupported by the XNA FrameworkAdditionConcatenates the two specified SqlString structures.
Public operatorStatic memberSupported by the XNA FrameworkEqualityPerforms a logical comparison of the two SqlString operands to determine whether they are equal.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlBoolean to SqlString)Converts the specified SqlBoolean structure to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlByte to SqlString)Converts the specified SqlByte structure to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlDateTime to SqlString)Converts the specified SqlDateTime parameter to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlDecimal to SqlString)Converts the specified SqlDecimal parameter to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlDouble to SqlString)Converts the specified SqlDouble parameter to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlGuid to SqlString)Converts the specified SqlGuid parameter to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlInt16 to SqlString)Converts the specified SqlInt16 parameter to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlInt32 to SqlString)Converts the specified SqlInt32 parameter to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlInt64 to SqlString)Converts the specified SqlInt64 parameter to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlMoney to SqlString)Converts the specified SqlMoney parameter to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlSingle to SqlString)Converts the specified SqlSingle parameter to SqlString.
Public operatorStatic memberSupported by the XNA FrameworkExplicit(SqlString to String)Converts a SqlString to a String
Public operatorStatic memberSupported by the XNA FrameworkGreaterThanPerforms a logical comparison of the two SqlString operands to determine whether the first is greater than the second.
Public operatorStatic memberSupported by the XNA FrameworkGreaterThanOrEqualPerforms a logical comparison of the two SqlString operands to determine whether the first is greater than or equal to the second.
Public operatorStatic memberSupported by the XNA FrameworkImplicit(String to SqlString)Converts the String parameter to a SqlString.
Public operatorStatic memberSupported by the XNA FrameworkInequalityPerforms a logical comparison of the two SqlString operands to determine whether they are not equal.
Public operatorStatic memberSupported by the XNA FrameworkLessThanPerforms a logical comparison of the two SqlString operands to determine whether the first is less than the second.
Public operatorStatic memberSupported by the XNA FrameworkLessThanOrEqualPerforms a logical comparison of the two SqlString operands to determine whether the first is less than or equal to the second.
Top

  NameDescription
Public fieldStatic memberSupported by the XNA FrameworkBinarySortSpecifies that sorts should be based on a characters numeric value instead of its alphabetical value.
Public fieldStatic memberSupported by the XNA FrameworkBinarySort2Specifies that sorts should be based on a character's numeric value instead of its alphabetical value.
Public fieldStatic memberSupported by the XNA FrameworkIgnoreCaseSpecifies that SqlString comparisons should ignore case.
Public fieldStatic memberSupported by the XNA FrameworkIgnoreKanaTypeSpecifies that the string comparison must ignore the Kana type.
Public fieldStatic memberSupported by the XNA FrameworkIgnoreNonSpaceSpecifies that the string comparison must ignore non-space combining characters, such as diacritics.
Public fieldStatic memberSupported by the XNA FrameworkIgnoreWidthSpecifies that the string comparison must ignore the character width.
Public fieldStatic memberSupported by the XNA FrameworkNullRepresents a DBNull that can be assigned to this instance of the SqlString structure.
Top

  NameDescription
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIXmlSerializable::GetSchemaThis member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIXmlSerializable::ReadXmlThis member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Explicit interface implemetationPrivate methodSupported by the XNA FrameworkIXmlSerializable::WriteXmlThis 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.

Community Additions

ADD
Show:
© 2014 Microsoft