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

  • Home
  • SEARCH
  • 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 7834089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:03:28+00:00 2026-06-02T13:03:28+00:00

In the below code I expect to retrn n rows but it always returns

  • 0

In the below code I expect to retrn n rows but it always returns zero rows as my initial set has zero records. Ideally it should be doing a UNION ALL and returning me records for all of the integers in the integer list clearanceTotals{6,7,8,9,17}
Any idea how to go about it?

    var tbl = (from a in db.Applicants
    where a.Id == null
    select new { a.Id, a.Firstname, a.Lastname });
    int thisTag;
    foreach (int c in clearanceTotals)
    {
        switch (c)
        {
            case 6:
                thisTag = 38;
                break;
            case 8:
                thisTag = 39;
                break;
            case 17:
                thisTag = 39;
                break;
            case 7:
                thisTag = 42;
                break;
            case 9:
                thisTag = 44;
                break;
        }
        tbl = (from a in db.Applicants
               join ad in db.ApplicantDeployments on a.Id equals ad.ApplicantId
               join aa in db.ApplicantAttachments on a.Id equals aa.ApplicantId
               where a.Nationality == 15 && a.DoNotUse == false && a.ClearanceStatus == c
               && aa.Tag == thisTag
               select new { a.Id, a.Firstname, a.Lastname }).Union(tbl);
    }
  • 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-02T13:03:29+00:00Added an answer on June 2, 2026 at 1:03 pm

    OK so i got this to work but its additional code plus additional variables

    var temp = (from a in db.Applicants 
    where a.Id == null 
    select a.Id).ToList(); 
    
    int thisTag; 
    foreach (int c in clearanceTotals) 
    { 
        switch (c) 
        { 
            case 6: 
                thisTag = 38; 
                break; 
            case 8: 
                thisTag = 39; 
                break; 
            case 17: 
                thisTag = 39; 
                break; 
            case 7: 
                thisTag = 42; 
                break; 
            case 9: 
                thisTag = 44; 
                break; 
        }
        temp = temp.Union(from a in db.Applicants 
               join ad in db.ApplicantDeployments on a.Id equals ad.ApplicantId 
               join aa in db.ApplicantAttachments on a.Id equals aa.ApplicantId 
               where a.Nationality == 15 && a.DoNotUse == false && a.ClearanceStatus == c 
               && aa.Tag == thisTag 
               select a.Id).ToList(); 
    }
    var tbl = (from a in db.Applicants
                          join ad in db.ApplicantDeployments on a.Id equals ad.ApplicantId
                          where temp.Contains(a.Id) 
                          select new { a.Id, a.Firstname, a.Lastname }).Distinct(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The below code seems like it should work; however, the blob in the database
With the below code, nothing appears in the ListActivity as I would expect. No
Possible Duplicate: Why has the destructor been called only once? Given the code below,
In the code sample below, I would expect the output to be as follows,
This code from my developer below... does it expect something like 1 - January
When I execute the code below in the simulator I expect to see red
What is the difference between the two pieces of code below? This returns the
Below code saying error incorreect syntax near Main INSERT INTO tbl ( 'Week', Main,
below code is my databasehandler class i got it from a tutorial. Beside that
Below code : URL oracle = new URL(http://www.oracle.com/); URLConnection inputStream =oracle.openConnection(); InputStream in =

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.