how to do that?
Main Topics
Browse All TopicsHi ,
how to union the return value with constant ?
my code comes the error says the union type incompitable.
I have to union them on linq becase this is used for a lookup control.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I researched this question in more detail, and I discovered what you really meant.
I created this example, and looked at the generated queries from AdventureWorks data:
var q1 = from employee in dc.vEmployees
select new { First = employee.FirstName, Last = employee.LastName };
var q2 = from employee in dc.vEmployees
select new { First = "(Blank)", Last = "(Blank)"};
q1
----
{SELECT [t0].[FirstName] AS [First], [t0].[LastName] AS [Last]
FROM [HumanResources].[vEmploye
}
q2
----
SELECT NULL AS [EMPTY]
FROM [HumanResources].[vEmploye
}
This appears to be a bug, since it doesn't generate the same queries, which make the Union incompatible.
I am looking into a work-around.
Business Accounts
Answer for Membership
by: TheLearnedOnePosted on 2009-10-28 at 06:19:31ID: 25682896
That sounds like you are trying to union between two different anonymous types, and it might explain the error. Did you try a single LINQ query statement instead?