I have the following query in MS Access and I'm trying to convert it to LINQ (vb.net)
Select Case Applications.APPLICATIONSIDNUMBER, Applications.TITLENO, Property.PremIDNumber, Property.Proptype, Property.Streetno,
Property.Range, Property.Street, Property.Address2, Property.ZipCode, Property.Subdiv, Property.Unit, Property.Interest,
Property.ReissueAD, Property.ReissueCD, Property.ReissueBL, Property.Grantor, Property.PDeedDay, Property.PDeedRday,
Property.PriorDBk, Property.PriorIns, Property.PriorInsDate, Property.PriorInsTN, Property.SurveyNo, Property.PerRP,
Property.MultiProp, Property.Comments, Property.Display, MuniCounty.Premises, MuniCounty.Village, MuniCounty.TOWN,
MuniCounty.CITY, MuniCounty.County, MuniCounty.COUNTYCD, MuniCounty.Zone, Applications.Statecode AS State
FROM (Applications INNER JOIN Property ON Applications.APPLICATIONSIDNUMBER = Property.APPLICATIONSIDNUMBER)
LEFT JOIN MuniCounty On Property.PremIDNumber = MuniCounty.MUNIDNUMBER;
The MuniCounty referenced in the above query is also a query:
Select MUN.MUNIDNUMBER, MUN.Premcode, MUN.Premises, MUN.COUNTYCD, MUN.Village, MUN.TOWN, MUN.CITY, MUN.ZipCode,
County.County, County.State, County.Zone, County.MTRate, County.AddTax, County.MTAZone
From County INNER Join MUN On County.CountyCd = MUN.COUNTYCD;
I was able to conver the SQL MuniCounty Query into LINQ:
Dim myMuniCty = (From muns In dc.MUNs
Join ctys In dc.Counties On muns.COUNTYCD Equals ctys.CountyCd
Select New With {muns.MUNIDNUMBER, muns.Premcode, muns.COUNTYCD, muns.Village, muns.TOWN, muns.CITY, muns.ZipCode,
ctys.County, ctys.State, ctys.Zone, ctys.MTRate, ctys.AddTax, ctys.MTAZone})
I'm trying to join the myMuniCty query results with the Applications and Property tables to achieve the results. But when I reference the myMuniCty I don't get the fields.
Can someone please help?
Thanks in advance
Edil