I’m using WhereParser.Parse with the string contents of a KVP in Settings.settings which contains the text of
the WhereExpression. The parser gives me a DA exception ‘EOF expected, but : 64269083 found’ when I try to
execute the Parse command. Curious because the specification for this input is simply string. I’m not sure why the
expectation of EOF.
new BinaryExpression(
new BinaryExpression(
new BinaryExpression(
new FieldExpression("YMDEFF"),
new ParameterExpression("As_Of_Date", DataType.LargeInt, 0),
BinaryOperator.LessOrEqual),
new BinaryExpression(
new FieldExpression("YMDEND"),
new ParameterExpression("As_Of_Date", DataType.LargeInt, 0),
BinaryOperator.GreaterOrEqual),
BinaryOperator.And),
//new BinaryExpression(
//new BinaryExpression(
// new FieldExpression("VOID"),
// new ConstantExpression(" ", DataType.String),
// BinaryOperator.Equal),
new BinaryExpression(
new FieldExpression("MEMBER_NBR"),
new ParameterExpression("Member_Nbr", DataType.WideString, 12),
BinaryOperator.Equal),
//BinaryOperator.And),
BinaryOperator.And);
Sorry, not sure I understand your answer. I’ve asked for a string you try to parse and exact code you use to do this while you provide some code that constructs a BinaryExpression, w/o any other explanations.
using System;
using RemObjects.DataAbstract.Expressions;
using RemObjects.DataAbstract.Schema;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
var expression = new BinaryExpression(
new BinaryExpression(
new BinaryExpression(
new FieldExpression("YMDEFF"),
new ParameterExpression("As_Of_Date", DataType.LargeInt, 0),
BinaryOperator.LessOrEqual),
new BinaryExpression(
new FieldExpression("YMDEND"),
new ParameterExpression("As_Of_Date", DataType.LargeInt, 0),
BinaryOperator.GreaterOrEqual),
BinaryOperator.And),
new BinaryExpression(
new FieldExpression("MEMBER_NBR"),
new ParameterExpression("Member_Nbr", DataType.WideString, 12),
BinaryOperator.Equal),
BinaryOperator.And);
var xml = expression.ToXmlString();
var expression2 = WhereExpression.FromString(xml);
Console.WriteLine("Successfully parsed");
Console.ReadKey();
}
}
}