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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:12:13+00:00 2026-06-05T19:12:13+00:00

I have the following query: tblVAL tblval = db.tblVALs.Where(p => p.PID == pid); Note

  • 0

I have the following query:

    tblVAL tblval = db.tblVALs.Where(p => p.PID == pid);

Note that I expect to get a list of items that should be returned.
tblVAL is a table in Entity Framework. NOTE THAT I NEED A LIST OF ITEMS TO BE RETURNED AS THERE CAN BE MORE THAN 1 ITEMS THAT IS RETURNS. AS SUCH, I DO NOT WANT TO USE First(), etc.

I get the following message

Cannot implicitly convert type ‘System.Linq.IQuerable to wa.Models.tblVAL’. An implicit converion exist (are you missing a cast? )

  • 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-05T19:12:16+00:00Added an answer on June 5, 2026 at 7:12 pm

    Your query is returning a collection. You need to call SingleOrDefault, Single, First, or FirstOrDefault to get a single record.

    tblVAL tblval = db.tblVALs.Where(p => p.PID == pid).SingleOrDefault();
    

    If you want a collection, change your variable type to a collection:

    IEnumerable<tblVAL> tblval = db.tblVALs.Where(p => p.PID == pid);
    

    You can also call ToList to force query execution:

    List<tblVAL> tblval = db.tblVALs.Where(p => p.PID == pid).ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following SQL query that selects some results from my table: select avg(c3),
I have the following query that runs in my Oracle database and I want
I have the following query in codeigniter The idea is to only get distinct
I have the following query: public class CheckItems { public String Description { get;
I have the following query that needs to be converted from Oracel PL/SQL to
I have the following query that I need to convert to rails like syntax.
I have the following Query: create table #Result (Reward varchar(40), Value MONEY); insert #Result
I have the following query: select column_name, count(column_name) from table group by column_name having
I have the following query that returns a set of rows based on some
I have following query which has select query that returns data in 5sec. But

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.