hi,
this is wat i've got so far:
VTest is the name of the view.
// Define fields
ResultsetFields fields = new ResultsetFields(3);
fields.DefineField(VTest.Customer, 0);
fields.DefineField(VTest.Employee, 1);
fields.DefineField(VTest.JustANumber, 2, AggregateFunction.Max);
// Define filter
PredicateExpression exp = new PredicateExpression(VTest.JustAnId == justAnId);
exp.Add(new FieldBetweenPredicate(VTest.JustADate, start, end));
PredicateExpression expIn = new PredicateExpression();
foreach (int order in orders)
{
expIn.AddWithOr(order);
}
exp.Add(expIn);
// Group by
GroupByCollection group = new GroupByCollection(fields[0]);
group.Add(fields[1]);
// Sort
SortExpression sort = new SortExpression(VTest.Customer | SortOperator.Ascending);
sort.Add(VTest.Employee | SortOperator.Ascending);
// Retrieve data
DataTable dt = null;
using (DataAccessAdapterBase adpt = new DataAccessAdapterBase())
{
adpt.FetchTypedList(fields, dt, null, 0, sort, false, group);
}
The problem is that I can't find a DataAccessAdapter class, only the base class (which you can't instantiate). How can i create an instance of the DataAccessAdapter (which dll needs referencing)? Maybe it has something to do with us using SelfService pattern? Also, since I'm just selecting from a view, how do I construct the FROM clause of the sqlStmt (i.e. FROM VTest)? I found an example which uses RelationPredicateBucket but I have just one view. Does LLBLGen detects this for you (from the fields which you enter in the select clause = fieldresultset)?
T.i.a.,
ratjetoes.