Advertisement

06.16.2008 at 09:20AM PDT, ID: 23488705
[x]
Attachment Details

Linq - Join in memory query with fresh query

Asked by suroma in Language Integrated Query - LINQ, Microsoft Visual Basic.Net, Visual Studio 2008

Tags: Linq

I would like to join and query an in memory query and a fresh linq query. I will try and explain.

I have a query in memory (CurrentItem.ItemClauses). I need to then join this to a fresh data base query (dbClause.LinksSpecificationClauses) so i can do a contains statement (on clauseid).  Here is my code at the moment but it is very slow.

Thanks

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
For Each TempClause In CurrentItem.ItemClauses
            Dim SpecID As Int32 = TempClause.SpecificationClauseID
            Dim lsc = (From s In dbClause.LinksSpecificationClauses _
                       Where s.SpecificationClauseID = SpecID).SingleOrDefault
            If lsc.ClauseID = ClauseID Then
                Return True
            End If
        Next
 
Loading Advertisement...
 
[+][-]06.16.2008 at 08:00PM PDT, ID: 21799284

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 08:44PM PDT, ID: 21799421

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.18.2008 at 06:25AM PDT, ID: 21812565

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Language Integrated Query - LINQ, Microsoft Visual Basic.Net, Visual Studio 2008
Tags: Linq
Sign Up Now!
Solution Provided By: naspinski
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628