Hi,
I am using llblgen pro version 5.3.3 and connecting to an ms access database (2010), and getting an unexpected result when trying to do a query with 2 fields of the same table concatenated, when looking for a record where 1 of the fields is empty it fails, while when both fields are not empty it works.
I have created a sample console project, and sample database with the minimum viable stuff to test the issue out https://www.dropbox.com/s/6ghr5br7jzwjipj/TestConcatenationIssue.7z?dl=0 the database needs to be placed in c: or the connection string needs to be changed, but besides that it should work out of the gate.
Either way the code is this:
var completeAddress1 = "Test Of the address name";
var completeAddress2 = "Address with Door NumberN535";
var qf = new QueryFactory();
var q1 = qf.Location.Where((LocationFields.Address + LocationFields.Door).Equal(completeAddress1));
var q2 = qf.Location.Where((LocationFields.Address + LocationFields.Door).Equal(completeAddress2));
var fetchedLocation1 = new EntityCollection<LocationEntity>();
var fetchedLocation2 = new EntityCollection<LocationEntity>();
using (var adapter = new DataAccessAdapter())
{
adapter.FetchQuery(q1, fetchedLocation1);
adapter.FetchQuery(q2, fetchedLocation2);
}
Console.WriteLine("Address without Door retrieved " + fetchedLocation1.Count + " records");
Console.WriteLine("Address with Door retrieved " + fetchedLocation2.Count + " records");
Console.WriteLine("Press Any key to close");
Console.ReadLine();
the generated query from q1 is this:
{SELECT
With projection:
Field: LocationEntity.Address
Field: LocationEntity.Door
Field: LocationEntity.Id
WHERE
PredicateExpression:
PredicateExpression:
Predicate:
FieldCompareValuePredicate:
Field:
Field: .ExF
Expression: (Expression)
Left operand:
Field: LocationEntity.Address
Operator: Add
Right operand:
Field: LocationEntity.Door
Equal
Constant: Test Of the address name
Additional information:
Offset: 0
Alias: ''
CacheResultset: False
}
and the generated query from q2 is exactly the same except for the constant line which is "Constant: Address with Door NumberN535".
Am I doing the joining of the fields to query wrong, and if so what is the correct way to do it?
Thank you.