Advertisement

05.07.2008 at 08:01AM PDT, ID: 23382995
[x]
Attachment Details

Simple LINQ query, need help forming it

Asked by cg_medistox in Language Integrated Query - LINQ, MS SQL Server, Visual Studio 2008

Tags: VB.NET, LINQ, http://www.every1preview.co.uk

I have a query which I would like to port to LINQ

I have so far got the query formed but i need to get it strongly typed so i can pass it around to a view in the asp mvc framework

The CarOffers class is just a class that the LINQ query types itself to

All i want to achieve is receive a distinct set of rows from the query that i can pass around.

I cannot use distinct as that messes around with the order of the query

Can someone help me understand how and what i can store the LINQ query in to pass it around for useStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
Dim Query = From Offers In DB.CarLeases _
                        Join Vehicles In DB.CAPVehicles On Offers.CapID Equals Vehicles.CVehicle_ID _
                        Join Images In DB.NVDModelYears On Offers.CapID Equals Images.MY_Id _
                        Where (Offers.SpecialOffer = True) _
                        Group By Offers.id Into CarOffer = Group _
                        From CO In CarOffer.Distinct() _
                        Select New CarOffers(CO.Offers.CapID, CO.Vehicles.CVehicle_ManText, _
                                             CO.Vehicles.CVehicle_ModText, CO.Vehicles.CVehicle_DerText, _
                                             CO.Offers.MonthlyPayment, CO.Images.MY_ImageID, CO.Offers.id)
 
Loading Advertisement...
 
[+][-]05.07.2008 at 08:17AM PDT, ID: 21517311

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.

 
[+][-]05.07.2008 at 08:25AM PDT, ID: 21517408

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.

 
[+][-]05.07.2008 at 09:07AM PDT, ID: 21517838

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.

 
[+][-]05.07.2008 at 01:42PM PDT, ID: 21520196

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.

 
[+][-]05.07.2008 at 01:51PM PDT, ID: 21520266

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.

 
[+][-]05.08.2008 at 12:37AM PDT, ID: 21522950

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.

 
[+][-]05.08.2008 at 03:15AM PDT, ID: 21523502

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, MS SQL Server, Visual Studio 2008
Tags: VB.NET, LINQ, http://www.every1preview.co.uk
Sign Up Now!
Solution Provided By: CarlVerret
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.08.2008 at 03:46AM PDT, ID: 21523615

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.

 
[+][-]05.08.2008 at 03:49AM PDT, ID: 21523631

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.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628