I am trying to union to queries to create an XML file. The query itself works as T-SQL, but my implementation as LINQ-TO-XML fails with "Could not translate expression..." error.
Am I asking the wrong question? Is this approach flat wrong? I am new to LINQ. How do I create a single XML from 2 queries?
Dim db As New SOMEDataContext
Dim members As New XElement("members", _
(From c In db.Employees _
Join cf In db.BowlingTeams On c.ID Equals cf.BowlingTeam_Text _
Where c.DEPARTMENT = "Housewares" _
Select New XElement("member", _
New XElement("id", c.ID), _
New XElement("title", c.TITLE))) _
.Union(From e In db.Employees _
Where e.DEPARTMENT = "Housewares" _
Where e.POSITION Like "*XYZ*" _
Select New XElement("member", _
New XElement("id", e.ID), _
New XElement("title", e.TITLE))))