当前位置: 首页>>代码示例>>C#>>正文


C# SqlTypes.SqlChars类代码示例

本文整理汇总了C#中System.Data.SqlTypes.SqlChars的典型用法代码示例。如果您正苦于以下问题:C# SqlChars类的具体用法?C# SqlChars怎么用?C# SqlChars使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SqlChars类属于System.Data.SqlTypes命名空间,在下文中一共展示了SqlChars类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetCapacity

 override public void SetCapacity(int capacity) {
     SqlChars[] newValues = new SqlChars[capacity];
     if (null != values) {
         Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
     }
     values = newValues;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:SQLCharsStorage.cs

示例2: FillMatch

 public static void FillMatch(object obj, out int index, out int length, out SqlChars value)
     {
     Match match = (Match)obj;
     index = match.Index;
     length = match.Length;
     value = new SqlChars(match.Value);
     }
开发者ID:yngcan,项目名称:TLS214-Disambiguation,代码行数:7,代码来源:GetMatches.cs

示例3: ConvertToPinyin

 public static SqlChars ConvertToPinyin(SqlChars input)
 {
     if (input.IsNull)
         return input;
     var str = new string(input.Value);
     return new SqlChars(StringConverter.GetChineseSpell(str));
 }
开发者ID:JodenSoft,项目名称:JodenSoft,代码行数:7,代码来源:ConvertToPinyin.cs

示例4: RegexGroup

 public static SqlChars RegexGroup( SqlChars input, SqlString pattern, SqlString name )
 {
     Regex regex = new Regex( pattern.Value, Options );
       Match match = regex.Match( new string( input.Value ) );
       return match.Success ?
         new SqlChars( match.Groups[name.Value].Value ) : SqlChars.Null;
 }
开发者ID:remifrazier,项目名称:SPCClogin_Public,代码行数:7,代码来源:RegexGroup.cs

示例5: RegexReplace

    public static SqlString RegexReplace(SqlChars input, SqlString pattern, SqlChars replacement)
    {
        Regex regex = new Regex(pattern.Value, Options);

        return regex.Replace(new string(input.Value),new string(replacement.Value));
        ///return regex.IsMatch(new string(input.Value)); ///The SQL datatype here is a BIT
    }
开发者ID:remifrazier,项目名称:SPCClogin_Public,代码行数:7,代码来源:RegexReplace.cs

示例6: FillMatchRow

 public static void FillMatchRow( object data,
    out SqlInt32 index, out SqlChars text )
 {
     MatchNode node = (MatchNode)data;
       index = new SqlInt32( node.Index );
       text = new SqlChars( node.Value.ToCharArray( ) );
 }
开发者ID:remifrazier,项目名称:SPCClogin_Public,代码行数:7,代码来源:RegexMatches.cs

示例7: SqlCharsItem

		public void SqlCharsItem ()
		{
			SqlChars chars = new SqlChars ();
			try {
				Assert.AreEqual (chars [0], 0, "#1 Should throw SqlNullValueException");
				Assert.Fail ("Should throw SqlNullValueException");
			} catch (Exception ex) {
				Assert.AreEqual (typeof (SqlNullValueException), ex.GetType (), "Should throw SqlNullValueException");
			}
			char [] b = null;
			chars = new SqlChars (b);
			try {
				Assert.AreEqual (chars [0], 0, "#2 Should throw SqlNullValueException");
				Assert.Fail ("Should throw SqlNullValueException");
			} catch (Exception ex) {
				Assert.AreEqual (typeof (SqlNullValueException), ex.GetType (), "Should throw SqlNullValueException");
			}
			b = new char [10];
			chars = new SqlChars (b);
			Assert.AreEqual (chars [0], 0, "");
			try {
				Assert.AreEqual (chars [-1], 0, "");
				Assert.Fail ("Should throw ArgumentOutOfRangeException");
			} catch (Exception ex) {
				Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "Should throw ArgumentOutOfRangeException");
			}
			try {
				Assert.AreEqual (chars [10], 0, "");
				Assert.Fail ("Should throw ArgumentOutOfRangeException");
			} catch (Exception ex) {
				Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "Should throw ArgumentOutOfRangeException");
			}
		}
开发者ID:LevNNN,项目名称:mono,代码行数:33,代码来源:SqlCharsTest.cs

示例8: TrimEnd

 internal static SqlString TrimEnd(SqlString src, SqlChars des)
 {
     if (IsAllNull(des)) return src;
     if (IsAllNull(src)) return SqlString.Null;
     string _s = src.Value;
     return new SqlString(_s.TrimEnd(des.Value));
 }
开发者ID:AimaTeam-hehai,项目名称:.NET-Extension-for-SqlServerClr,代码行数:7,代码来源:SqlStringUtility.cs

示例9: FillRow

 public static void FillRow(Object obj, out SqlDateTime timeWritten, out SqlChars message, out SqlChars category, out long instanceId)
 {
     EventLogEntry eventLogEntry = (EventLogEntry)obj;
     timeWritten = new SqlDateTime(eventLogEntry.TimeWritten);
     message = new SqlChars(eventLogEntry.Message);
     category = new SqlChars(eventLogEntry.Category);
     instanceId = eventLogEntry.InstanceId;
 }
开发者ID:jshield,项目名称:sqlperms,代码行数:8,代码来源:ClrTableFunction.cs

示例10: FillGroupRow

 public static void FillGroupRow( object data,
    out SqlInt32 index, out SqlChars group, out SqlChars text )
 {
     GroupNode node = (GroupNode)data;
       index = new SqlInt32( node.Index );
       group = new SqlChars( node.Name.ToCharArray( ) );
       text = new SqlChars( node.Value.ToCharArray( ) );
 }
开发者ID:remifrazier,项目名称:SPCClogin_Public,代码行数:8,代码来源:RegexGroups.cs

示例11: FillRegExRow

 /// <summary>
 /// FillRow method to populate the output table
 /// </summary>
 /// <param name=”obj”>RegExRow passed as object</param>
 /// <param name=”rowId”>ID or the returned row</param>
 /// <param name=”matchId”>ID of returned Match</param>
 /// <param name=”groupID”>ID of group in the Match</param>
 /// <param name=”value”>Value of the Group</param>
 public static void FillRegExRow( Object obj, out int rowId, out int matchId, out int groupID, out SqlChars value )
 {
     RegExRow r = (RegExRow)obj;
     rowId = r.RowId;
     matchId = r.MatchId;
     groupID = r.GroupID;
     value = new SqlChars( r.Value );
 }
开发者ID:kingbin,项目名称:Snippits,代码行数:16,代码来源:SQLRegEx.cs

示例12: FillAdjustedPrice

 public static void FillAdjustedPrice(Object obj, out SqlInt32 itemId, out SqlMoney adjustedPrice, out SqlMoney averagePrice, out SqlChars itemName)
 {
     CCPDatum Item = (CCPDatum)obj;
     itemId = new SqlInt32(Item.item_id);
     adjustedPrice = new SqlMoney(Item.adjustedPrice);
     averagePrice = Item.averagePrice.HasValue ? new SqlMoney(Item.averagePrice.Value) : SqlMoney.Null;
     itemName = new SqlChars(Item.item_name);
 }
开发者ID:Caleth,项目名称:EVE-SDE-tools,代码行数:8,代码来源:AdjustedPrices.cs

示例13: ConvertToTraditionalChinese

    public static SqlChars ConvertToTraditionalChinese(SqlChars input)
    {
        if (input.IsNull)
            return input;

        var str = new string(input.Value);
        // 在此处放置代码
        return new SqlChars(Strings.StrConv(str, VbStrConv.TraditionalChinese, 0));
    }
开发者ID:JodenSoft,项目名称:JodenSoft,代码行数:9,代码来源:ConvertToTraditionalChinese.cs

示例14: ConvertToProperCase

    public static SqlChars ConvertToProperCase(SqlChars input)
    {
        if (input.IsNull)
            return input;

        var str = new string(input.Value);
        // 在此处放置代码
        return new SqlChars(Strings.StrConv(str, VbStrConv.ProperCase, 0));
    }
开发者ID:JodenSoft,项目名称:JodenSoft,代码行数:9,代码来源:ConvertToProperCase.cs

示例15: TrimStartAndEnd

 internal static SqlString TrimStartAndEnd(SqlString src, SqlChars startDes, SqlChars endDes)
 {
     if (IsAllNull(startDes, endDes)) return src;
     if (IsAllNull(src)) return SqlString.Null;
     string _s = src.Value;
     if (!endDes.IsNull) _s = _s.TrimEnd(endDes.Value);
     if (!startDes.IsNull) _s = _s.TrimStart(startDes.Value);
     return new SqlString(_s);
 }
开发者ID:AimaTeam-hehai,项目名称:.NET-Extension-for-SqlServerClr,代码行数:9,代码来源:SqlStringUtility.cs


注:本文中的System.Data.SqlTypes.SqlChars类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。