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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:48:19+00:00 2026-05-14T03:48:19+00:00

I am trying to run this code: ItemTaxonomy iTaxonomy = from itemTaxonomy in connection.ItemTaxonomy

  • 0

I am trying to run this code:

ItemTaxonomy iTaxonomy = from itemTaxonomy in connection.ItemTaxonomy
                         where itemTaxonomy.Item.ID == itemView.ID
                         orderby itemTaxonomy.Taxonomy.Name
                         select itemTaxonomy;

When I compiled it I get the error:

Cannot implicitly convert type
'System.Linq.IOrderedQueryable<Website.Models.ItemTaxonomy>' to
'Website.Models.ItemTaxonomy'. An explicit conversion exists (are you missing a cast?)

I believe the issue is with orderby itemTaxonomy.Taxonomy.Name but I am just trying to order by the name of Taxonomy items instead of their IDs. Is there a way to do that?

  • 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-14T03:48:20+00:00Added an answer on May 14, 2026 at 3:48 am

    No, the problem is that the result is a sequence whereas your variable is a single item.

    Given that you’re expressing ordering, you must be expecting multiple values – so what do you want to do with them? Options:

    • Use First():

      ItemTaxonomy iTaxonomy = (from itemTaxonomy in connection.ItemTaxonomy
                                where itemTaxonomy.Item.ID == itemView.ID
                                orderby itemTaxonomy.Taxonomy.Name
                                select itemTaxonomy).First();
      

      This will return the ItemTaxonomy with the earliest name out of all the ones with the appropriate item ID.

    • Change your variable type:

      IEnumerable<ItemTaxonomy> taxonomies = 
          from itemTaxonomy in connection.ItemTaxonomy
          where itemTaxonomy.Item.ID == itemView.ID
          orderby itemTaxonomy.Taxonomy.Name
          select itemTaxonomy;
      

      Now you’ve got a sequence of taxonomies to deal with, instead of a single item.

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

Sidebar

Related Questions

I'm trying to run this code taken from Sun Java site (I didn't copy
Under Python 3.1, when trying to run this code: from urllib import request def
I am trying to run this piece of code taken from http://coffeescriptcookbook.com embedding it
I'm trying to run this code: let coins = [50, 25, 10, 5, 2,1]
Trying to convert this c code into MIPS and run it in SPIM. int
I am trying to run this SQL from ASP.NET 2005 but am getting an
I am trying to run this simple SELECT query using PDO::MySQL, but it does
Im trying to run this code . Basically I want the https://admin:qwerty123@ '$dmp':7777/set_param?'$params command
I'm trying to run this code on Oracle 11g and it's giving me the
I am trying to run this line of code: Process p = Runtime.getRuntime().exec(new String[]

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.