• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SqlTypes.SqlChars类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Accumulate

 /// <summary>
 /// 把每个值进行累加
 /// </summary>
 /// <param name="value"></param>
 public void Accumulate(SqlChars value, SqlString connector)
 {
     if (value.IsNull)
         return;
     if (splitterLength == 0)
         splitterLength = (connector.IsNull ? "," : connector.Value).Length;
     // 在此处放置代码
     result.Append(value.Value).Append(connector.IsNull ? "," : connector.Value);
 }
开发者ID:JodenSoft,项目名称:JodenSoft,代码行数:13,代码来源:ConcatString.cs


示例17: RegexReplaceRecursive

 public static SqlString RegexReplaceRecursive(SqlChars input, SqlString pattern, SqlChars replacement)
 {
     string output = new string( input.Value );
     Regex regex = new Regex(pattern.Value, Options);
     while (regex.IsMatch( output ))
     {
         output = regex.Replace(output, new string(replacement.Value));
     }
     return output;
 }
开发者ID:remifrazier,项目名称:SPCClogin_Public,代码行数:10,代码来源:RegexReplaceRecursive.cs


示例18: ContainsAny

 public static SqlBoolean ContainsAny(SqlChars input, string search)
 {
     string strTemp = new string(input.Value);
     foreach (string item in search.Split(','))
     {
         if (strTemp.Contains(item))
         {
             return true;
         }
     }
     return false;
 }
开发者ID:henrydem,项目名称:yongfa365doc,代码行数:12,代码来源:Function1.cs


示例19: ToSafeFileNameWith

    public static SqlString ToSafeFileNameWith(SqlString text, SqlChars substitution)
    {
        if (text.IsNull || String.IsNullOrWhiteSpace(text.Value)) return SqlString.Null;

        var textValue = text.Value.Trim();

        var substitutionChar = substitution.Value[0];

        var fileName = Path.GetInvalidFileNameChars().Aggregate(textValue, (current, c) => current.Replace(c, substitutionChar));

        return new SqlString(fileName, text.LCID);
    }
开发者ID:raziqyork,项目名称:Geeks.SqlUtils,代码行数:12,代码来源:ToSafeFileName.cs


示例20: PadRight

    public static SqlChars PadRight(SqlChars input, SqlInt32 totalWidth, char paddingChar)
    {
        if (input.IsNull)
            return input;

        if (paddingChar == (char)0)
            return input;

        if (totalWidth.IsNull || totalWidth < 0)
            totalWidth = 0;

        // 在此处放置代码
        return new SqlChars(new string(input.Value).PadRight(totalWidth.Value, paddingChar));
    }
开发者ID:JodenSoft,项目名称:JodenSoft,代码行数:14,代码来源:PadRight.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SqlTypes.SqlDateTime类代码示例发布时间:2022-05-26
下一篇:
C# SqlTypes.SqlBytes类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap