本文整理汇总了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;
}
示例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);
}
示例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));
}
示例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;
}
示例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
}
示例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( ) );
}
示例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");
}
}
示例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));
}
示例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;
}
示例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( ) );
}
示例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 );
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}