Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8501219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:08:57+00:00 2026-06-11T01:08:57+00:00

I had a run-time error when the following code was executed: (vb.net) dim q

  • 0

I had a run-time error when the following code was executed: (vb.net)

dim q = (From x in db.T1
         select x.F11, x.F12).Union( _
        (From y in db.T2
         select y.F21, y.F22)

F11 and F21 have the same type; F21 and F22 have the same type.

The runtime error stated “Unable to cast from DataQuery(of anonymous type(…) to iEnumerable (of anonymous type…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:08:59+00:00Added an answer on June 11, 2026 at 1:08 am

    Union on anonymous types should work. Compiler is intelligent enough to treat two anonymous types are same. Double check your field types in database of tow tables they should be exactly same

    You can try union on same table to see this

    (From x in db.T1
             select FIRST=x.F11, SECOND=x.F21).Union( _
            (From y in db.T1
             select FIRST=y.F11, SECOND=y.F21)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following error from my code execution: Microsoft JScript runtime error: Could
The following code samples produce the same error when I perform the SAVEAS: Microsoft.Office.Interop.Excel.Application
Upon running the following code, in a project from F# WPF template, to which
I had successfully compiled a static version of qt4.8.2 by following the instructions from
I had some code that ran commands through Runtime.getRuntime.exec(String) , and it worked on
In a previous question on Stack Overflow , I had run into an issue
I recently had to run a job that required all the mappers to finish
A little knowledge can be a dangerous thing. Now that I've had a run
I had a Java program that I run thousand times based on a loop
I have run into a bit of a problem here: I had a problem-specific

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.