System.Data.SqlTypes.SqlChars.ToSqlString C# (CSharp) Method

ToSqlString() public method

public ToSqlString ( ) : SqlString
return SqlString
        public SqlString ToSqlString()
        {
            return IsNull ? SqlString.Null : new string(Value);
        }

Usage Example

Beispiel #1
0
    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;
    }
All Usage Examples Of System.Data.SqlTypes.SqlChars::ToSqlString