本文整理汇总了C#中SqlCompareOptions类的典型用法代码示例。如果您正苦于以下问题:C# SqlCompareOptions类的具体用法?C# SqlCompareOptions怎么用?C# SqlCompareOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlCompareOptions类属于命名空间,在下文中一共展示了SqlCompareOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SmiExtendedMetaData
internal SmiExtendedMetaData(SqlDbType dbType, long maxLength, byte precision, byte scale, long localeId, SqlCompareOptions compareOptions, Type userDefinedType, string udtAssemblyQualifiedName, bool isMultiValued, IList<SmiExtendedMetaData> fieldMetaData, SmiMetaDataPropertyCollection extendedProperties, string name, string typeSpecificNamePart1, string typeSpecificNamePart2, string typeSpecificNamePart3) : base(dbType, maxLength, precision, scale, localeId, compareOptions, userDefinedType, udtAssemblyQualifiedName, isMultiValued, fieldMetaData, extendedProperties)
{
this._name = name;
this._typeSpecificNamePart1 = typeSpecificNamePart1;
this._typeSpecificNamePart2 = typeSpecificNamePart2;
this._typeSpecificNamePart3 = typeSpecificNamePart3;
}
示例2: SmiQueryMetaData
internal SmiQueryMetaData(SqlDbType dbType, long maxLength, byte precision, byte scale, long localeId, SqlCompareOptions compareOptions, Type userDefinedType, string udtAssemblyQualifiedName, bool isMultiValued, IList<SmiExtendedMetaData> fieldMetaData, SmiMetaDataPropertyCollection extendedProperties, string name, string typeSpecificNamePart1, string typeSpecificNamePart2, string typeSpecificNamePart3, bool allowsDBNull, string serverName, string catalogName, string schemaName, string tableName, string columnName, SqlBoolean isKey, bool isIdentity, bool isColumnSet, bool isReadOnly, SqlBoolean isExpression, SqlBoolean isAliased, SqlBoolean isHidden) : base(dbType, maxLength, precision, scale, localeId, compareOptions, userDefinedType, udtAssemblyQualifiedName, isMultiValued, fieldMetaData, extendedProperties, name, typeSpecificNamePart1, typeSpecificNamePart2, typeSpecificNamePart3, allowsDBNull, serverName, catalogName, schemaName, tableName, columnName, isKey, isIdentity, isColumnSet)
{
this._isReadOnly = isReadOnly;
this._isExpression = isExpression;
this._isAliased = isAliased;
this._isHidden = isHidden;
}
示例3: SmiStorageMetaData
internal SmiStorageMetaData(SqlDbType dbType, long maxLength, byte precision, byte scale, long localeId, SqlCompareOptions compareOptions, Type userDefinedType, string udtAssemblyQualifiedName, bool isMultiValued, IList<SmiExtendedMetaData> fieldMetaData, SmiMetaDataPropertyCollection extendedProperties, string name, string typeSpecificNamePart1, string typeSpecificNamePart2, string typeSpecificNamePart3, bool allowsDBNull, string serverName, string catalogName, string schemaName, string tableName, string columnName, SqlBoolean isKey, bool isIdentity, bool isColumnSet) : base(dbType, maxLength, precision, scale, localeId, compareOptions, userDefinedType, udtAssemblyQualifiedName, isMultiValued, fieldMetaData, extendedProperties, name, typeSpecificNamePart1, typeSpecificNamePart2, typeSpecificNamePart3)
{
this._allowsDBNull = allowsDBNull;
this._serverName = serverName;
this._catalogName = catalogName;
this._schemaName = schemaName;
this._tableName = tableName;
this._columnName = columnName;
this._isKey = isKey;
this._isIdentity = isIdentity;
this._isColumnSet = isColumnSet;
}
示例4: SqlMetaData
// Private constructor used to initialize default instance array elements.
// DO NOT EXPOSE OUTSIDE THIS CLASS! It performs no validation.
private SqlMetaData(String name,
SqlDbType sqlDbType,
long maxLength,
byte precision,
byte scale,
long localeId,
SqlCompareOptions compareOptions,
bool partialLength)
{
AssertNameIsValid(name);
_strName = name;
_sqlDbType = sqlDbType;
_lMaxLength = maxLength;
_bPrecision = precision;
_bScale = scale;
_lLocale = localeId;
_eCompareOptions = compareOptions;
_bPartialLength = partialLength;
ThrowIfUdt(sqlDbType);
}
示例5: SqlMetaData
// Most general constructor, should be able to intialize all SqlMetaData fields.(Used by SqlParameter)
internal SqlMetaData (String name,
SqlDbType sqlDBType,
long maxLength,
byte precision,
byte scale,
long localeId,
SqlCompareOptions compareOptions,
string xmlSchemaCollectionDatabase,
string xmlSchemaCollectionOwningSchema,
string xmlSchemaCollectionName,
bool partialLength,
Type udtType) {
AssertNameIsValid(name);
m_strName = name;
m_sqlDbType = sqlDBType;
m_lMaxLength = maxLength;
m_bPrecision = precision;
m_bScale = scale;
m_lLocale = localeId;
m_eCompareOptions = compareOptions;
m_XmlSchemaCollectionDatabase = xmlSchemaCollectionDatabase;
m_XmlSchemaCollectionOwningSchema = xmlSchemaCollectionOwningSchema;
m_XmlSchemaCollectionName = xmlSchemaCollectionName;
m_bPartialLength = partialLength;
m_udttype = udtType;
}
示例6: CreateSortedSqlStringList
private static SortedList<SqlString, SqlString> CreateSortedSqlStringList(int numberOfItems, SqlCompareOptions compareOption, CultureInfo cInfo, int localeID)
{
SortedList<SqlString, SqlString> items = new SortedList<SqlString, SqlString>(numberOfItems);
//
// Generate list of SqlString
//
Random rand = new Random(500);
int numberOfWords;
StringBuilder builder = new StringBuilder();
SqlString word;
for (int i = 0; i < numberOfItems; ++i)
{
do
{
builder.Clear();
numberOfWords = rand.Next(10) + 1;
for (int j = 0; j < numberOfWords; ++j)
{
builder.Append(s_sampleString[rand.Next(s_sampleStringCount)]);
builder.Append(" ");
}
if (numberOfWords % 2 == 1)
{
for (int k = 0; k < rand.Next(100); ++k)
{
builder.Append(' ');
}
}
word = new SqlString(builder.ToString(), localeID, compareOption);
} while (items.ContainsKey(word));
items.Add(word, word);
}
return items;
}
示例7: SmiMetaData
internal SmiMetaData(
SqlDbType dbType,
long maxLength,
byte precision,
byte scale,
long localeId,
SqlCompareOptions compareOptions,
Type userDefinedType,
SmiMetaData[] columns) :
// Implement as calling the new ctor
this(
dbType,
maxLength,
precision,
scale,
localeId,
compareOptions,
userDefinedType ) {
Debug.Assert( null == columns, "Row types not supported" );
}
示例8: SmiQueryMetaData
internal SmiQueryMetaData( SqlDbType dbType,
long maxLength,
byte precision,
byte scale,
long localeId,
SqlCompareOptions compareOptions,
Type userDefinedType,
string name,
string typeSpecificNamePart1,
string typeSpecificNamePart2,
string typeSpecificNamePart3,
bool allowsDBNull,
string serverName,
string catalogName,
string schemaName,
string tableName,
string columnName,
SqlBoolean isKey,
bool isIdentity,
bool isReadOnly,
SqlBoolean isExpression,
SqlBoolean isAliased,
SqlBoolean isHidden ) :
this( dbType,
maxLength,
precision,
scale,
localeId,
compareOptions,
userDefinedType,
false,
null,
null,
name,
typeSpecificNamePart1,
typeSpecificNamePart2,
typeSpecificNamePart3,
allowsDBNull,
serverName,
catalogName,
schemaName,
tableName,
columnName,
isKey,
isIdentity,
isReadOnly,
isExpression,
isAliased,
isHidden) {
}
示例9: SmiStorageMetaData
// SMI V200 ctor.
internal SmiStorageMetaData(
SqlDbType dbType,
long maxLength,
byte precision,
byte scale,
long localeId,
SqlCompareOptions compareOptions,
Type userDefinedType,
bool isMultiValued,
IList<SmiExtendedMetaData> fieldMetaData,
SmiMetaDataPropertyCollection extendedProperties,
string name,
string typeSpecificNamePart1,
string typeSpecificNamePart2,
string typeSpecificNamePart3,
bool allowsDBNull,
string serverName,
string catalogName,
string schemaName,
string tableName,
string columnName,
SqlBoolean isKey,
bool isIdentity) :
this( dbType,
maxLength,
precision,
scale,
localeId,
compareOptions,
userDefinedType,
null,
isMultiValued,
fieldMetaData,
extendedProperties,
name,
typeSpecificNamePart1,
typeSpecificNamePart2,
typeSpecificNamePart3,
allowsDBNull,
serverName,
catalogName,
schemaName,
tableName,
columnName,
isKey,
isIdentity,
false) {
}
示例10: SmiParameterMetaData
// SMI V220 ctor.
internal SmiParameterMetaData(
SqlDbType dbType,
long maxLength,
byte precision,
byte scale,
long localeId,
SqlCompareOptions compareOptions,
Type userDefinedType,
string udtAssemblyQualifiedName,
bool isMultiValued,
IList<SmiExtendedMetaData> fieldMetaData,
SmiMetaDataPropertyCollection extendedProperties,
string name,
string typeSpecificNamePart1,
string typeSpecificNamePart2,
string typeSpecificNamePart3,
ParameterDirection direction) :
base( dbType,
maxLength,
precision,
scale,
localeId,
compareOptions,
userDefinedType,
udtAssemblyQualifiedName,
isMultiValued,
fieldMetaData,
extendedProperties,
name,
typeSpecificNamePart1,
typeSpecificNamePart2,
typeSpecificNamePart3) {
Debug.Assert( ParameterDirection.Input == direction
|| ParameterDirection.Output == direction
|| ParameterDirection.InputOutput == direction
|| ParameterDirection.ReturnValue == direction, "Invalid direction: " + direction );
_direction = direction;
}
示例11: SqlMetaData
public SqlMetaData (string name, SqlDbType type, long maxLength, long locale, SqlCompareOptions compareOptions)
{
this.compareOptions = compareOptions;
this.localeId = locale;
this.maxLength = maxLength;
this.name = name;
this.sqlDbType = type;
}
示例12: SqlStringCompareTest
private static void SqlStringCompareTest(int numberOfItems, SqlCompareOptions compareOption, CultureInfo cInfo, int localeID)
{
SortedList<SqlString, SqlString> items = CreateSortedSqlStringList(numberOfItems, compareOption, cInfo, localeID);
VerifySortedSqlStringList(items, compareOption, cInfo);
}
示例13: VerifySortedSqlStringList
private static void VerifySortedSqlStringList(SortedList<SqlString, SqlString> items, SqlCompareOptions compareOption, CultureInfo cInfo)
{
//
// Verify the list is in order
//
IList<SqlString> keyList = items.Keys;
for (int i = 0; i < items.Count - 1; ++i)
{
SqlString currentString = keyList[i];
SqlString nextString = keyList[i + 1];
Assert.True((bool)((currentString < nextString) && (nextString >= currentString)), "FAILED: (SqlString Operator Comparison): SqlStrings are out of order");
Assert.True((currentString.CompareTo(nextString) < 0) && (nextString.CompareTo(currentString) > 0), "FAILED: (SqlString.CompareTo): SqlStrings are out of order");
switch (compareOption)
{
case SqlCompareOptions.BinarySort:
Assert.True(CompareBinary(currentString.Value, nextString.Value) < 0, "FAILED: (SqlString BinarySort Comparison): SqlStrings are out of order");
break;
case SqlCompareOptions.BinarySort2:
Assert.True(string.CompareOrdinal(currentString.Value.TrimEnd(), nextString.Value.TrimEnd()) < 0, "FAILED: (SqlString BinarySort2 Comparison): SqlStrings are out of order");
break;
default:
CompareInfo cmpInfo = cInfo.CompareInfo;
CompareOptions cmpOptions = SqlString.CompareOptionsFromSqlCompareOptions(nextString.SqlCompareOptions);
Assert.True(cmpInfo.Compare(currentString.Value.TrimEnd(), nextString.Value.TrimEnd(), cmpOptions) < 0, "FAILED: (SqlString Comparison): SqlStrings are out of order");
break;
}
}
}
示例14: SmiExtendedMetaData
internal SmiExtendedMetaData(
SqlDbType dbType,
long maxLength,
byte precision,
byte scale,
long localeId,
SqlCompareOptions compareOptions,
Type userDefinedType,
string name,
string typeSpecificNamePart1,
string typeSpecificNamePart2,
string typeSpecificNamePart3) :
this(
dbType,
maxLength,
precision,
scale,
localeId,
compareOptions,
userDefinedType,
false,
null,
null,
name,
typeSpecificNamePart1,
typeSpecificNamePart2,
typeSpecificNamePart3) {
}
示例15: Construct
// Construction for string types with specified locale/compare options
private void Construct(String name,
SqlDbType dbType,
long maxLength,
long locale,
SqlCompareOptions compareOptions,
bool useServerDefault,
bool isUniqueKey,
SortOrder columnSortOrder,
int sortOrdinal)
{
AssertNameIsValid(name);
ValidateSortOrder(columnSortOrder, sortOrdinal);
// Validate type and max length.
if (SqlDbType.Char == dbType)
{
if (maxLength > x_lServerMaxANSI || maxLength < 0)
throw ADP.Argument(Res.GetString(Res.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), "maxLength");
}
else if (SqlDbType.VarChar == dbType)
{
if ((maxLength > x_lServerMaxANSI || maxLength < 0) && maxLength != Max)
throw ADP.Argument(Res.GetString(Res.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), "maxLength");
}
else if (SqlDbType.NChar == dbType)
{
if (maxLength > x_lServerMaxUnicode || maxLength < 0)
throw ADP.Argument(Res.GetString(Res.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), "maxLength");
}
else if (SqlDbType.NVarChar == dbType)
{
if ((maxLength > x_lServerMaxUnicode || maxLength < 0) && maxLength != Max)
throw ADP.Argument(Res.GetString(Res.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), "maxLength");
}
else if (SqlDbType.NText == dbType || SqlDbType.Text == dbType)
{
// old-style lobs only allowed with Max length
if (SqlMetaData.Max != maxLength)
throw ADP.Argument(Res.GetString(Res.ADP_InvalidDataLength2, maxLength.ToString(CultureInfo.InvariantCulture)), "maxLength");
}
else
throw SQL.InvalidSqlDbTypeForConstructor(dbType);
// Validate locale?
// Validate compare options
// Binary sort must be by itself.
// Nothing else but the Ignore bits is allowed.
if (SqlCompareOptions.BinarySort != compareOptions &&
0 != (~((int)SqlCompareOptions.IgnoreCase | (int)SqlCompareOptions.IgnoreNonSpace |
(int)SqlCompareOptions.IgnoreKanaType | (int)SqlCompareOptions.IgnoreWidth) &
(int)compareOptions))
throw ADP.InvalidEnumerationValue(typeof(SqlCompareOptions), (int)compareOptions);
SetDefaultsForType(dbType);
_strName = name;
_lMaxLength = maxLength;
_lLocale = locale;
_eCompareOptions = compareOptions;
_useServerDefault = useServerDefault;
_isUniqueKey = isUniqueKey;
_columnSortOrder = columnSortOrder;
_sortOrdinal = sortOrdinal;
}