本文整理汇总了C#中System.Data.SqlTypes.SqlChars.ToSqlString方法的典型用法代码示例。如果您正苦于以下问题:C# SqlChars.ToSqlString方法的具体用法?C# SqlChars.ToSqlString怎么用?C# SqlChars.ToSqlString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlTypes.SqlChars
的用法示例。
在下文中一共展示了SqlChars.ToSqlString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SplitString
public static IEnumerable SplitString(SqlChars input, SqlChars splitter)
{
string[] array;
if (input.IsNull)
{
array = new string[] { null };
}
else if (splitter.IsNull)
{
array = new string[] { input.ToSqlString().Value };
}
else
{
string inputStr = input.ToSqlString().Value;
string sepStr = splitter.ToSqlString().Value;
string[] separatorsArray = sepStr.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
array = inputStr.Split(separatorsArray, StringSplitOptions.RemoveEmptyEntries);
}
return array;
}
示例2: ToSqlString
/// <summary>
/// Converts the value of the specified SqlChars to its equivalent SqlString representation.
/// </summary>
/// <param name="value">An SqlChars.</param>
/// <returns>The SqlString equivalent of the SqlChars.</returns>
public static SqlString ToSqlString(SqlChars value) { return value.ToSqlString(); }
示例3: ToString
/// <summary>
/// Converts the value of the specified SqlChars to its equivalent String representation.
/// </summary>
/// <param name="value">An SqlChars.</param>
/// <returns>The String equivalent of the SqlChars.</returns>
public static String ToString(SqlChars value) { return value.IsNull ? null : value.ToSqlString().Value; }
示例4: ToXmlDocument
/// <summary>
/// Converts the value of the specified SqlChars to its equivalent XmlDocument representation.
/// </summary>
/// <param name="value">An SqlChars.</param>
/// <returns>The equivalent XmlDocument.</returns>
public static XmlDocument ToXmlDocument(SqlChars value) { return value.IsNull ? null : ToXmlDocument(value.ToSqlString().Value); }
示例5: ToXmlReader
/// <summary>
/// Converts the value of the specified SqlChars to its equivalent XmlReader representation.
/// </summary>
/// <param name="value">An SqlChars.</param>
/// <returns>The equivalent XmlReader.</returns>
public static XmlReader ToXmlReader(SqlChars value) { return value.IsNull ? null : new XmlTextReader(new StringReader(value.ToSqlString().Value)); }
示例6: ToSqlXml
/// <summary>
/// Converts the value of the specified SqlChars to its equivalent SqlXml representation.
/// </summary>
/// <param name="value">An SqlChars.</param>
/// <returns>The equivalent SqlXml.</returns>
public static SqlXml ToSqlXml(SqlChars value) { return value.IsNull ? SqlXml.Null : new SqlXml(new XmlTextReader(new StringReader(value.ToSqlString().Value))); }
示例7: ToSqlString
/// <summary>Converts the value from <c>SqlChars</c> to an equivalent <c>SqlString</c> value.</summary>
public static SqlString ToSqlString(SqlChars p) { return p.ToSqlString(); }
示例8: ToString
/// <summary>Converts the value from <c>SqlChars</c> to an equivalent <c>String</c> value.</summary>
public static String ToString(SqlChars p) { return p.IsNull ? Configuration.NullableValues.String : p.ToSqlString().Value; }
示例9: ToXElement
/// <summary>Converts the value from <c>SqlChars</c> to an equivalent <c>XElement</c> value.</summary>
public static XElement ToXElement(SqlChars p) { return p.IsNull ? null : ToXElement(p.ToSqlString().Value); }
示例10: ToString
/// <summary>Converts the value from <c>SqlChars</c> to an equivalent <c>String</c> value.</summary>
public static String ToString(SqlChars p) { return p.IsNull? null : p.ToSqlString().Value; }
示例11: Split
public static IEnumerator Split(SqlChars instr, [SqlFacet(IsFixedLength = true, MaxSize = 1)]SqlString delimiter)
{
return ((instr.IsNull || delimiter.IsNull) ? new SplitString("", ',') : new SplitString(instr.ToSqlString().Value, Convert.ToChar(delimiter.Value)));
}