SqlString SqlString SqlString SqlString Struct

定義

表示要儲存在資料庫或自資料庫擷取之字元的可變長度資料流。Represents a variable-length stream of characters to be stored in or retrieved from the database. SqlString 具有與其在 .NET Framework 中對應的 String 資料類型不同的基礎資料結構。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
繼承
屬性
實作

備註

String一律會使用目前CultureInfo執行緒的預設值, 但SqlString會包含其本身的地區設定識別碼和比較旗標。String always uses the default CultureInfo from the current thread, but SqlString contains its own locale Id and compare flags. 兩個SqlString結構的比較結果與作業系統和目前線程的地區設定無關。The comparison result of two SqlString structures is independent of operating system and current thread locale.

當您使用SqlString比較運算子時, 請注意, 如果引數的 lcid 不同, 比較函數會擲回例外狀況, 因為它們無法進行比較。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);  

建構函式

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

使用指定的字串,初始化 SqlString 結構的新執行個體。Initializes a new instance of the SqlString structure using the specified string.

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

使用指定的字串與地區設定 ID (Locale ID) 值,初始化 SqlString 結構的新執行個體。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[])

使用指定的地區設定 ID、比較選項和資料,初始化 SqlString 結構的新執行個體。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)

用指定的字串、地區設定 ID 和比較選項值,初始化 SqlString 結構的新執行個體。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)

初始化 SqlString 類別的新執行個體。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)

初始化 SqlString 類別的新執行個體。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)

初始化 SqlString 類別的新執行個體。Initializes a new instance of the SqlString class.

欄位

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

指定 SqlString 比較必須應該忽略大小寫。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

指定字串比較必須忽略非空格組合的字元,例如變音符號 (Diacritic)。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

表示 DBNull,可以指派至 SqlString 結構的執行個體。Represents a DBNull that can be assigned to this instance of the SqlString structure.

屬性

CompareInfo CompareInfo CompareInfo CompareInfo

取得 CompareInfo 物件,其定義應該如何為這個 SqlString 結構執行字串比較。Gets the CompareInfo object that defines how string comparisons should be performed for this SqlString structure.

CultureInfo CultureInfo CultureInfo CultureInfo

取得 CultureInfo 結構,其表示有關這個 SqlString 物件的文化特性 (Culture) 資訊。Gets the CultureInfo structure that represents information about the culture of this SqlString object.

IsNull IsNull IsNull IsNull

表示這個 SqlString 結構是否為 Null。Indicates whether this SqlString structure is null.

LCID LCID LCID LCID

指定 SqlString 結構的地理地區設定和語言。Specifies the geographical locale and language for the SqlString structure.

SqlCompareOptions SqlCompareOptions SqlCompareOptions SqlCompareOptions

一個或多個 SqlCompareOptions 列舉 (Enumeration) 值的組合表示應該將這個 SqlString 與其他 SqlString 結構相比較的方式。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

取得存放在這個 SqlString 結構中的字串。Gets the string that is stored in this SqlString structure. 這個屬性是唯讀的。This property is read-only.

方法

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

將兩個指定的 SqlString 參數串連,以建立新的 SqlString 結構。Concatenates two specified SqlString values to create a new SqlString structure.

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

建立這個 SqlString 物件的複本。Creates a copy of this SqlString object.

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

取得指定 SqlCompareOptions 值的相等 CompareOptions 列舉。Gets the CompareOptions enumeration equivalent of the specified SqlCompareOptions value.

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

將這個 SqlString 執行個體與提供的 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)

將這個 SqlString 物件與提供的 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)

將兩個指定的 SqlString 結構串連在一起。Concatenates the two specified SqlString structures.

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

將提供的物件參數與 Value 物件的 SqlString 屬性相比較。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()

取得位元組的陣列,包含 ANSI 格式的 SqlString 內容。Gets an array of bytes, that contains the contents of the SqlString in ANSI format.

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

取得位元組的陣列,包含 Unicode 格式的 SqlString 內容。Gets an array of bytes, that contains the contents of the SqlString in Unicode format.

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

傳回指定之 XmlSchemaSet 的 XML 結構描述定義語言 (XSD)。Returns the XML Schema definition language (XSD) of the specified XmlSchemaSet.

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

執行兩個 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)

執行兩個 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)

執行兩個 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)

執行兩個 SqlString 運算元的邏輯比對,以判斷它們是否不相等。Performs a logical comparison of the two SqlString operands to determine whether they are not equal.

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

將這個 SqlString 結構轉換為 SqlBooleanConverts this SqlString structure to SqlBoolean.

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

將這個 SqlString 結構轉換為 SqlByteConverts this SqlString structure to SqlByte.

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

將這個 SqlString 結構轉換為 SqlDateTimeConverts this SqlString structure to SqlDateTime.

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

將這個 SqlString 結構轉換為 SqlDecimalConverts this SqlString structure to SqlDecimal.

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

將這個 SqlString 結構轉換為 SqlDoubleConverts this SqlString structure to SqlDouble.

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

將這個 SqlString 結構轉換為 SqlGuidConverts this SqlString structure to SqlGuid.

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

將這個 SqlString 結構轉換為 SqlInt16Converts this SqlString structure to SqlInt16.

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

將這個 SqlString 結構轉換為 SqlInt32Converts this SqlString structure to SqlInt32.

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

將這個 SqlString 結構轉換為 SqlInt64Converts this SqlString structure to SqlInt64.

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

將這個 SqlString 結構轉換為 SqlMoneyConverts this SqlString structure to SqlMoney.

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

將這個 SqlString 結構轉換為 SqlSingleConverts this SqlString structure to SqlSingle.

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

SqlString 物件轉換成 StringConverts a SqlString object to a String.

運算子

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

將兩個指定的 SqlString 結構串連在一起。Concatenates the two specified SqlString structures.

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

SqlString 轉換成 StringConverts a SqlString to a String

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

將指定的 SqlSingle 參數轉換成 SqlStringConverts the specified SqlSingle parameter to SqlString.

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

將指定的 SqlMoney 參數轉換成 SqlStringConverts the specified SqlMoney parameter to SqlString.

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

將指定的 SqlInt64 參數轉換成 SqlStringConverts the specified SqlInt64 parameter to SqlString.

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

將指定的 SqlInt16 參數轉換成 SqlStringConverts the specified SqlInt16 parameter to SqlString.

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

將指定的 SqlInt32 參數轉換成 SqlStringConverts the specified SqlInt32 parameter to SqlString.

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

將指定的 SqlDouble 參數轉換成 SqlStringConverts the specified SqlDouble parameter to SqlString.

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

將指定的 SqlDecimal 參數轉換成 SqlStringConverts the specified SqlDecimal parameter to SqlString.

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

將指定的 SqlDateTime 參數轉換成 SqlStringConverts the specified SqlDateTime parameter to SqlString.

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

將指定的 SqlByte 結構轉換成 SqlStringConverts the specified SqlByte structure to SqlString.

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

將指定的 SqlBoolean 結構轉換成 SqlStringConverts the specified SqlBoolean structure to SqlString.

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

將指定的 SqlGuid 參數轉換成 SqlStringConverts the specified SqlGuid parameter to SqlString.

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

執行兩個 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)

String 參數轉換成 SqlStringConverts the String parameter to a SqlString.

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

執行兩個 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)

執行兩個 SqlString 運算元的邏輯比對,判斷第一個運算元是否小於或等於第二個。Performs a logical comparison of the two SqlString operands to determine whether the first is less than or equal to the second.

明確介面實作

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

此成員支援 .NET Framework 基礎結構,並不能直接使用於您的程式碼中。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)

此成員支援 .NET Framework 基礎結構,並不能直接使用於您的程式碼中。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)

此成員支援 .NET Framework 基礎結構,並不能直接使用於您的程式碼中。This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

適用於

另請參閱