System.Data.SqlTypes.SqlString Structure

Represents a variable-length stream of characters to be stored in or retrieved from the database. System.Data.SqlTypes.SqlString has a different underlying data structure from its corresponding .NET Framework string data type.

See Also: SqlString Members

Syntax

[System.Xml.Serialization.XmlSchemaProvider("GetXsdType")]
public struct SqlString : INullable, IComparable, System.Xml.Serialization.IXmlSerializable

Remarks

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

When you use System.Data.SqlTypes.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

Example

 SqlString mySqlString = new SqlString("abc");

is equivalent to

Example

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

Requirements

Namespace: System.Data.SqlTypes
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0