本文整理汇总了C#中System.Data.SqlTypes.SqlString.GetNonUnicodeBytes方法的典型用法代码示例。如果您正苦于以下问题:C# SqlString.GetNonUnicodeBytes方法的具体用法?C# SqlString.GetNonUnicodeBytes怎么用?C# SqlString.GetNonUnicodeBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlTypes.SqlString
的用法示例。
在下文中一共展示了SqlString.GetNonUnicodeBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public void Create()
{
// SqlString (String)
SqlString TestString = new SqlString ("Test");
AssertEquals ("#A01", "Test", TestString.Value);
// SqlString (String, int)
TestString = new SqlString ("Test", 2057);
AssertEquals ("#A02", 2057, TestString.LCID);
// SqlString (int, SqlCompareOptions, byte[])
TestString = new SqlString (2057,
SqlCompareOptions.BinarySort|SqlCompareOptions.IgnoreCase,
new byte [2] {123, 221});
AssertEquals ("#A03", 2057, TestString.CompareInfo.LCID);
// SqlString(string, int, SqlCompareOptions)
TestString = new SqlString ("Test", 2057, SqlCompareOptions.IgnoreNonSpace);
Assert ("#A04", !TestString.IsNull);
// SqlString (int, SqlCompareOptions, byte[], bool)
TestString = new SqlString (2057, SqlCompareOptions.BinarySort, new byte [4] {100, 100, 200, 45}, true);
AssertEquals ("#A05", (byte)63, TestString.GetNonUnicodeBytes () [0]);
TestString = new SqlString (2057, SqlCompareOptions.BinarySort, new byte [2] {113, 100}, false);
AssertEquals ("#A06", (String)"qd", TestString.Value);
// SqlString (int, SqlCompareOptions, byte[], int, int)
TestString = new SqlString (2057, SqlCompareOptions.BinarySort, new byte [2] {113, 100}, 0, 2);
Assert ("#A07", !TestString.IsNull);
// SqlString (int, SqlCompareOptions, byte[], int, int, bool)
TestString = new SqlString (2057, SqlCompareOptions.IgnoreCase, new byte [3] {100, 111, 50}, 1, 2, false);
AssertEquals ("#A08", "o2", TestString.Value);
TestString = new SqlString (2057, SqlCompareOptions.IgnoreCase, new byte [3] {123, 111, 222}, 1, 2, true);
Assert ("#A09", !TestString.IsNull);
}