[Mono-dev] Re: Invalid escape selecting table rows

Robert Jordan robertj at gmx.net
Thu Jun 8 11:55:27 EDT 2006


> I select them using
> 
> Tables[0].Select("(PAGE='\wsngmono\Categ.aspx' OR 
> PAGE='/wsngmono/Categ.aspx') AND (CONTROL='' OR CONTROL IS NULL) AND 
> ENABLED=0")
> 
> and I obtain this error:
> 
> System.Data.SyntaxErrorException: Invalid escape sequence: '\s'.
> in <0x00118> Mono.Data.SqlExpressions.Tokenizer:ProcessEscapes (Char c)
> in <0x000cc> Mono.Data.SqlExpressions.Tokenizer:ReadString (Char 
> terminator, Boolean canEscape)
> in <0x0015b> Mono.Data.SqlExpressions.Tokenizer:ParseToken ()
> in <0x00030> Mono.Data.SqlExpressions.Tokenizer:advance ()
> in <0x00274> Mono.Data.SqlExpressions.Parser:yyparse (yyInput yyLex)
> in <0x00112> Mono.Data.SqlExpressions.Parser:Compile (System.String 
> sqlExpr)
> in <0x000dd> System.Data.DataTable:Select (System.String 
> filterExpression, System.String sort, DataViewRowState recordStates)
> in <0x00014> System.Data.DataTable:Select (System.String filterExpression)
> 
> Apparently there's no escape sequence in the query, I'm doing something 
> wrong?


Escape all "\" with "\\".

Robert




More information about the Mono-devel-list mailing list