Code so far without the fieldcomparesetpredicate. Am in the process of changing to meet new requriements so was investigating the best way to do this.
ResultsetFields fields = new ResultsetFields(5);
fields.DefineField(StaffFields.Name, 0);
fields.DefineField(StatusFields.Descr, 1, "Status");
fields.DefineField(NotificationFields.Descr, 2, "Reason");
fields.DefineField(NotificationFields.NotificationDt, 3);
fields[3].SetExpression(new DbFunctionCall("CONVERT(CHAR(10),{0},103)", new object[] { NotificationFields.NotificationDt }));
fields.DefineField(NotificationFields.WeekDate, 4);
fields[4].SetExpression(new DbFunctionCall("CONVERT(CHAR(10),{0},103)", new object[] { NotificationFields.WeekDate }));
// add joins to tables
bucket = new RelationPredicateBucket();
bucket.Relations.Add(NotificationEntity.Relations.StatusEntityUsingStatusId, JoinHint.Inner);
bucket.Relations.Add(NotificationEntity.Relations.StaffEntityUsingStaffId, JoinHint.Inner);
// add where clauses
bucket.PredicateExpression.Add(StatusFields.StatusId == statEnt.StatusId);
if (wrkGrpID !=0)
bucket.PredicateExpression.AddWithAnd(StaffFields.WorkGroupId == wrkGrpID);
else
bucket.PredicateExpression.AddWithAnd(StaffFields.StaffId == staff.StaffId);
//sort by name
SortExpression sort = new SortExpression();
sort.Add(StaffFields.Name | SortOperator.Ascending);
sort.Add(NotificationFields.WeekDate | SortOperator.Ascending);
//set up the table to store the result
DataTable dtResults = new DataTable("Results");
adapter.FetchTypedList(fields, dtResults, bucket, 0, sort, false);
Am using Version 2.6 of LLBLGen. Am using .Net20.dll runtime versions.
thanks