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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:03:45+00:00 2026-05-16T14:03:45+00:00

Function Edit(ByVal id As Integer) As ActionResult Dim entities As New Deployment_devEntities() Dim w

  • 0
     Function Edit(ByVal id As Integer) As ActionResult


        Dim entities As New Deployment_devEntities()
        Dim w As System.Data.Objects.ObjectQuery(Of tblWebsites) = entities.CreateQuery(Of tblWebsites)("SELECT VALUE m FROM tblWebsites as m WHERE m.WebsiteID = " & id)

        Dim q = From m In entities.tblWebsites Where m.WebsiteID = id Select m

        Return View(q.Single())

    End Function

I have a strong typed view of type EntityFrameworkTest.tblWebsites when I pass in the results using either Linq to Entity or Entity SQL I get this error:

The model item passed into the dictionary is of type 'System.Data.Objects.ObjectQuery`1[EntityFrameworkTest.tblWebsites]', 
but this dictionary requires a model item of type 'EntityFrameworkTest.tblWebsites'.

What am I doing wrong?

The code is example only.

  • 1 1 Answer
  • 2 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-16T14:03:45+00:00Added an answer on May 16, 2026 at 2:03 pm

    Either your view needs to inherit from IEnumerable<tblWebsites> or you need to change your controller to return a single instance of tblWebsites. You can do this with the LINQ .FirstOrDefault() method.

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

Sidebar

Related Questions

I've got a Controller ActionResult that looks like this Function Edit(ByVal user As Domain.User,
<HttpPost()> Function Edit(<Bind(Prefix:=Article)> ByVal Article As FormCollection, Optional ByVal DepartementID As Integer = 0,
I register the following function //EDIT: updated $("#id").on("change", function() { alert('xxx'); }); In my
I tried the following: $.load(Views/chatBox.html).appendTo('body') Console Output: TypeError: $.load is not a function EDIT
I have this function to edit all fields that come from the form and
I'm trying to add an edit function to my web app but I'm having
I have an HTML table where I'm building an edit function to change a
I have a function that allows users to edit a row in a table
I'm using CreateWindowEx() function to create an EDIT window, i.e. where a user can
EDIT : Per Slaks $j('#banner-content img').each(function() { var link = $j('#page-tabs li a.' +

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.