Sorry if this is the wrong area for this query.
I'm getting the following error:
Relation at index 1 doesn't contain an entity already added to the FROM clause. Bad alias?
My code is:
Dim results As New System.Data.DataTable()
Dim fields As New ResultsetFields(4)
fields.DefineField(TrainingCourseFields.Summary, 0)
fields.DefineField(TrainingSessionFields.Capacity, 1)
fields.DefineField(TrainingBookingFields.EmployeeId, 2)
fields.DefineField(EmployeeFields.Name, 3)
fields(1).AggregateFunctionToApply = AggregateFunction.Sum
fields(2).AggregateFunctionToApply = AggregateFunction.Count
Dim relations As IRelationCollection = New RelationCollection()
relations.Add(Training.EntityClasses.EmployeeEntity.Relations.TrainingCourseEntityUsingTrainer)
relations.Add(Training.EntityClasses.TrainingBookingEntity.Relations.TrainingSessionEntityUsingSessionId)
relations.Add(Training.EntityClasses.TrainingCourseEntity.Relations.TrainingSessionEntityUsingCourseId)
Dim groupByClause As IGroupByCollection = New GroupByCollection()
groupByClause.Add(fields(0))
groupByClause.Add(fields(1))
groupByClause.Add(fields(3))
Dim CustomerDynamicList As New Training.DaoClasses.TypedListDAO()
CustomerDynamicList.GetMultiAsDataTable(fields, results, 0, Nothing, Nothing, relations, False, Nothing, Nothing, 0, 0)
rptCourses.DataSource = results
rptCourses.DataBind()
I'm using LLBLGen Pro 2.0, Visual Studio 2005 with VB for an ASP web page.
I don't know if this has anything to do with my Employee table having relations to both the TrainingCourse and TrainingBooking tables?