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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:32:46+00:00 2026-05-23T07:32:46+00:00

The steps I go through… Add new ADO.NET Entity Data Model > Generate from

  • 0

The steps I go through…

  • Add new ADO.NET Entity Data Model > Generate from DB > Setup new connection string to adventureworks db > Next > Select table “DatabaseLog” > Finish. Verify DatabaseLog is visible in the edmx view.

  • Right click controller > Add controller

  • Template
    Controller with read/write actions and views, using Entity

  • Model class
    AdventureWorksDWEntities

  • Context
    New data Context > Accept default name

  • View
    Razor

  • Click Add.

Produce Error:
“Unable to retrieve metadata for ‘DatabaseDocumentor.models.AdventureWorksDWEntities’.

  • System.Data.Edm.EdmEntityeType: EntityType ‘AdventureWorksDWEntities’ has no key defined. Define the key for this entitytype.

  • System.Data.Edm.EdmEntitySet: EntityType: EntitySet ‘AdventureWorksDWEntities’ is based on type ‘AdventureWorksDWEntities’ that has no keys defined.


I tried again using AdventureWorks (not AdventureWorksDW) and this time it worked. But, I still don’t understand what to pick when generating a controller. I have 3 options:

Template
Here I picked Controller with read/write actions and views, using Entity. This is easy enough to understand. I want to have my tables generated for me so I pick this option.

Model
This is what I want to model. In this case I want to model the “Department” table. So I choose Department.

Context
This one is real fuzzy to me. I chose *Name*Entities. This is the value in the web.config connection strings area. Why do I need to choose my connection string as the context? I only know context as “an object that I use to get to my entities” in C#. So, here it’s hard for me to visualize. Do I need to always choose my connection string for the context?

  • 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-23T07:32:46+00:00Added an answer on May 23, 2026 at 7:32 am

    This issue can occur when the Context is not correctly chosen from the dropdown. The context should be the value stored in the web.config

    <add name="NamedEntitiesCs1"
    

    that also contains the Model you want to generate.

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

Sidebar

Related Questions

I have a recursive algorithm which steps through a string, character by character, and
So I am following this guide: http://technotes.1000lines.net/?p=23 and I am going through the steps.
What steps I need to perform in order to convert asp.net 2 application from
I've got a dictionary, something like Dictionary<Foo,String> fooDict I step through everything in the
Rep steps: create example .NET form application put a TextBox on the form wire
Is there an easier way to step through the code than to start the
Is there a way to step through a .bat script? The thing is, I
I would like to be able to step through an application deployed to a
I am walking through the MS Press Windows Workflow Step-by-Step book and in chapter
I am playing with TFS 2010, and am trying to setup a build process

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.