vb.net - LINQ-TO-XML using UNION -


After

I am trying to create a XML file to resolve the questions. T-SQL works itself as a query, but "the expression could not be translated ..." error.

I'm asking the wrong question as the LINQ-to-XML fails with my implementation? Is this view wrong? I'm new to LINQ How can I create a single XML from 2 queries?

DD DB New SOMEDataContext Smoke members as New XElement ("Member", as _ (c db.Employees in _CF Join Database in BowlingTeams on c.id. cf. BowlingTeam_Text equals _ where c.DEPARTMENT = "household items" _New XElement ("Member", _New XElement ("ID", c.ID), _New XElement ("Title", select C. TITLE))) _Union (in the D.B. Implications where E. Department = "Homeware" _ where E. position "* XYZ *" select _New Eximplements ("Member", _NewExample ("id", E.id), _New XElement ("title", e.TITLE)))

Here's how I will do that in VB:

  Blind members = & lt; Members & gt; & Lt;% = c to db.Employees_ Join the CF in db.BowlingTeams at c.ID equals cf.BowlingTeam_Text _ where c.DEPARTMENT = "Housewares" _ Choose & lt; Members & gt; & Lt; Id & gt; & Lt;% = c.id% & gt; & Lt; / Id & gt; & Lt; Title & gt; & Lt;% = c.TITLE% & gt; & Lt; / Heading & gt; & Lt; / Member & gt; & Gt%; & Lt;% = In DB Employees _ where E. Department = "houseware" _ where e Position "* XYZ *" _ Select & lt; Members & gt; & Lt; Id & gt; & Lt;% = e.id% & gt; & Lt; / Id & gt; & Lt; Title & gt; & Lt;% = E. Title% & gt; & Lt; / Heading & gt; & Lt; / Member & gt; & Gt%; & Lt; / Members & gt;  

It takes advantage of XML Literal, which avoids the need for all the New Execution calls.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -