I'm just now getting started with QuerySpec. I am trying to use the FetchAsDataTable method because we need DataSets (with related DataTables) for some report creation tasks.
I'm trying to do the equivalent of "Select * from Customers" with this code.
var qf = new QueryFactory();
PredicateExpression filter = new PredicateExpression();
filter.Add(CustomerFields.Country == country);
DynamicQuery query = qf.Create()
.Select(qf.Customer)
.Where(filter);
using (var adapter = new DataAccessAdapter())
{
DataTable table = adapter.FetchAsDataTable(query);
}
The exception message that I get is:
"Couldn't create any correlation filter lambda because the nested query didn't have any correlation filters. Please specify a filter in the nested query to tie the nested query to the parent query"
What am I missing?