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

InvalidDate() public static method

public static InvalidDate ( string date ) : Exception
date string
return System.Exception
        public static Exception InvalidDate(string date)
        {
            return _Syntax(SR.Format(SR.Expr_InvalidDate, date));
        }

Usage Example

Example #1
0
        /// <summary>
        ///     Just read the string between '#' signs, and parse it later
        /// </summary>
        private void ScanDate()
        {
            char[] text = _text;

            do
            {
                _pos++;
            } while (_pos < text.Length && text[_pos] != '#');

            if (_pos >= text.Length || text[_pos] != '#')
            {
                // Bad date constant
                if (_pos >= text.Length)
                {
                    throw ExprException.InvalidDate(new string(text, _start, (_pos - 1) - _start));
                }
                else
                {
                    throw ExprException.InvalidDate(new string(text, _start, _pos - _start));
                }
            }
            else
            {
                _token = Tokens.Date;
            }
            _pos++;
        }
All Usage Examples Of System.Data.ExprException::InvalidDate