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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:14:21+00:00 2026-06-03T01:14:21+00:00

We need to store a list of data we pull from another table that

  • 0

We need to store a list of data we pull from another table that relates to one of our models. (We are too deep into build to add this relationship to our DB where it should be.) When we attempt to load this list in a property of the model that needs it.

We load this list into a dropdown in a view. The error occurs trying to load this list into the model in the controller. The true caveat is that we have a unique dropdown list for each record in our table in the view.

Our Class:

Public class OurModel
  public property ID As Integer
  Public property First As Integer
  Public property Last As Integer
  Public property myList As List(Of SelectListItem)//This is our problem member
End class

Controller:

                         //This ViewModel is what we pass around from page to page to populate the various elements we need that is not tied to a specific model
Public Function LoadList(myViewModel As ViewModel) As Action Result
   Using db //our database resource 
    For i As Integer = 0 to myViewModel.OurModel
       //Assume table select statement previously declared and initialized into dbGet
       **NOTE: dbGet is retieving data from a different table that is tied to this Model**
       dbGet = dbGet.Where(Function(x) x.ID = myViewModel.OurModel.ID)
       myViewModel.OurModel.myList = dbGet.ToList().[Select](Function(x) New SelectListItem() With {.Value = x.number, .Text = x.number})//ERROR IS HERE
    Next
   End Using
End Function

Error:

LINQ to Entities does not recognize the method ‘DB.ModelTable get_Item(Int32)’ method, and this method cannot be translated into a store expression.

UPDATE: The issue appears to be that LINQ is trying to do something with a the DBContext of a query I do previously in this controller. The error is referencing DB.Employee not DB.Position which is what I am querying.

  • 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-03T01:14:23+00:00Added an answer on June 3, 2026 at 1:14 am

    I ended up having to write new classes that connected to the database outside of Entity Framework. If you want to use Entity Framework, make sure you database design is PERFECT before you begin building your application and good luck.

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

Sidebar

Related Questions

I am a beginner in C++. I need to store list of addresses that
I have a list of users in local store that I need to update
I need an efficient data structure to store a list of integers. The amount
I need to store data in memory where I map one or more key
I need to store some data that looks a little like this: xyz 123
I need to store basic data of customer's and cars that they bought and
I have some user-specific data that I need to store in SharePoint and make
I need to pull data from two tables, and it's a bit over my
I have two database tables. One table stores data for a commitment that a
I'm designing a table in SQL Server 2008 that will store a list of

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.