This question is locked. New answers and comments are not allowed.
Trying to do a basic join with the query below
When result.ToList() is called to try and bind to a repeater, ORM comes back with a "The Last accepted query piece is not from the this query"
If I switch the IObjectScopeQuery to just a simple List
I get an object reference not set to a reference.
I'm guessing the ORM is returning the similar error.
Any help would be appreciated.
Thanks
-Matt
Dim Scope As IObjectScope = PartnerSummary.ObjectScopeProvider1.GetNewObjectScope() |
Dim result1 As IObjectScopeQuery(Of PartnerSummary.PartnerInitiative) = From pInit In Scope.Extent(Of PartnerSummary.PartnerInitiative)() _ |
Where pInit.PartnerSummaryID = mPartnerSummaryID _ |
Select pInit |
Dim initiatives As IObjectScopeQuery(Of PartnerSummary.Initiative) = From I In Scope.Extent(Of PartnerSummary.Initiative)() Select I |
Dim tmp1 As IObjectScopeQuery(Of PartnerSummary.Initiative) = initiatives |
Dim tmp2 As IObjectScopeQuery(Of PartnerSummary.PartnerInitiative) = result1 |
Dim result = From Inits In tmp1 _ |
Group Join pInit In tmp2 _ |
On Inits.InitiativeID Equals pInit.Id _ |
Into OV = Group _ |
From pInit2 In OV.DefaultIfEmpty() _ |
Select New PartnerSummary.PartnerInitiativeQuestions With { _ |
.InitiativeID = Inits.InitiativeID, _ |
.Description = Inits.Description, _ |
.Value = If(OV Is Nothing, 0, pInit2.Value), _ |
.Comment = If(OV Is Nothing, "", pInit2.Comment), _ |
.PartnerIniativesID = If(OV Is Nothing, 0, pInit2.PartnerIntiativesID)} |
When result.ToList() is called to try and bind to a repeater, ORM comes back with a "The Last accepted query piece is not from the this query"
If I switch the IObjectScopeQuery to just a simple List
Dim Scope As IObjectScope = PartnerSummary.ObjectScopeProvider1.GetNewObjectScope() |
Dim result1 As IObjectScopeQuery(Of PartnerSummary.PartnerInitiative) = From pInit In Scope.Extent(Of PartnerSummary.PartnerInitiative)() _ |
Where pInit.PartnerSummaryID = mPartnerSummaryID _ |
Select pInit |
Dim initiatives As IObjectScopeQuery(Of PartnerSummary.Initiative) = From I In Scope.Extent(Of PartnerSummary.Initiative)() Select I |
Dim tmp1 As List(Of PartnerSummary.Initiative) = initiatives.ToList() |
Dim tmp2 As List(Of PartnerSummary.PartnerInitiative) = result1.ToList |
Dim result = From Inits In tmp1 _ |
Group Join pInit In tmp2 _ |
On Inits.InitiativeID Equals pInit.Id _ |
Into OV = Group _ |
From pInit2 In OV.DefaultIfEmpty() _ |
Select New PartnerSummary.PartnerInitiativeQuestions With { _ |
.InitiativeID = Inits.InitiativeID, _ |
.Description = Inits.Description, _ |
.Value = If(OV Is Nothing, 0, pInit2.Value), _ |
.Comment = If(OV Is Nothing, "", pInit2.Comment), _ |
.PartnerIniativesID = If(OV Is Nothing, 0, pInit2.PartnerIntiativesID)} |
I get an object reference not set to a reference.
I'm guessing the ORM is returning the similar error.
Any help would be appreciated.
Thanks
-Matt