System.Data.ExprException.InvalidString C# (CSharp) Method

InvalidString() public static method

public static InvalidString ( string str ) : Exception
str string
return System.Exception
        public static Exception InvalidString(string str)
        {
            return _Syntax(SR.Format(SR.Expr_InvalidString, str));
        }

Usage Example

Example #1
0
        private void ScanString(char escape)
        {
            char[] text = _text;

            while (_pos < text.Length)
            {
                char ch = text[_pos++];

                if (ch == escape && _pos < text.Length && text[_pos] == escape)
                {
                    _pos++;
                }
                else if (ch == escape)
                {
                    break;
                }
            }

            if (_pos >= text.Length)
            {
                throw ExprException.InvalidString(new string(text, _start, (_pos - 1) - _start));
            }

            _token = Tokens.StringConst;
        }
All Usage Examples Of System.Data.ExprException::InvalidString