Hello,
I am just getting my feet wet in EntitySpaces. I am trying to bind a join query to a asp.net gridview and keep getting the message "field not found". I know that it has something to do with having the same field name "description" in the joined tables. I can bind other fields in the joins but when I included the two "description" fields from two joined tables I get the message "Field not found in data source". I have tried alias and combination of things from the forum but not able to come up with anything.
I am using SQL2005 and Visual Studio 2008.
This is this exact error message that is returned per my code snippet below.
"A field or property with the name 'Description1' was not found on the selected data source."
GoalQuery
qGoal = new GoalQuery("g");
InterventionTypeQuery qIntType = new InterventionTypeQuery("it");
GoalAreaQuery qGoalArea = new GoalAreaQuery("ga");
UserQuery qUser = new UserQuery("u");
qGoal.Select
(
qGoal.Description.Coalesce(
"g.Description"),
qIntType.Description.Coalesce(
"it.Description")
);
qGoal.InnerJoin(qIntType).On (qIntType.InterventionTypeID==qGoal.InterventionTypeID);
qGoal.InnerJoin(qGoalArea).On(qGoalArea.GoalAreaID == qGoal.GoalAreaID);
qGoal.InnerJoin(qUser).On(qUser.UserID == qGoal.CreatedByUserID);
GoalCollection Coll = new GoalCollection();
Coll.Load(qGoal);
I get the same error results when removing the Coalesce statements
qGoal.Select
(
qGoal.Description,
qIntType.Description
);