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 4588076
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:52:16+00:00 2026-05-21T21:52:16+00:00

I am having some trouble figuring out what parameters to pass in my .ToSelectList()

  • 0

I am having some trouble figuring out what parameters to pass in my .ToSelectList() so i can display my results in a dropdown list box. I have two IQueryable items and i want to display the results together in one dropdown. I don’t have to compare and match it is simply grap and display. A sample of how the results look like is:

Teacher
Doctor
Nurse
Engineer
Jack Smith
Tim Jones
Jill Jack

Here is how my code looks so far:

IQueryable<Report_JobResults> jobs=
            _jobsReportRepository.summaryGetJob().OrderBy(o=>o.JobName);

IQueryable<Report_nameResult> users =
           _nameReportRepository.summaryGetName().OrderBy(n => n.FirstName).ThenBy(
               n => n.LastName);

//Here is where i display results into a dropdown box.

view.Results=jobs.Select(o => o.jobId).ToList().Union(users.Select(u =>     u.userId).ToList()).ToSelectList();

I am not sure what the parameters will be in the .ToSelectList()

Help will be very much appreciated. 🙂

thanks

  • 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-05-21T21:52:17+00:00Added an answer on May 21, 2026 at 9:52 pm

    You can try

    var results = jobs.Select(o => o.jobId).Union(users.Select(u => u.userId))
        .Select( i => new SelectListItem
        {
            Text = i,
            Value = i
        };
    

    and use results for in Html.DropDownListFor().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble figuring this out. I have an unordered list menu that
I'm having some trouble figuring out to call methods that I have in other
I having some trouble figuring this problem out where I have one button which
I'm having some trouble figuring out the right way to do this: I have
I have been having some trouble figuring out how exactly I get a process's
I'm having some trouble figuring out why I can only get the children of
I'm having some trouble figuring this out. I have the following CSV string hello
I'm having trouble figuring out how to pass strings back through the parameters of
I am having some trouble figuring out why I am only receiving one reply
I'm having some trouble figuring out how to add elements to a parent object

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.