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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:45:09+00:00 2026-05-23T11:45:09+00:00

Visual studio is giving me a trail of errors that I have hit a

  • 0

Visual studio is giving me a trail of errors that I have hit a dead end on. I am trying to add an existing table in a database to my data model. I understand that the table should have a key, but it doesn’t and I can’t fix that; it isn’t my database to re-design.

When I first try to add the table, I get this error:

The table/view
‘BT8_GC.dbo.SAVED_QUERY_CATEGORY’ does
not have a primary key defined and no
valid primary key could be inferred.
This table/view has been excluded. To
use the entity, you will need to
review your schema, add the correct
keys, and uncomment it.

Ok, fine, I’ll define the keys for it and uncomment. Here is the block I uncomment, after manually defining the keys (I also had to add the nullable=false part):

      <EntityType Name="SAVED_QUERY_CATEGORY">
    <Key>
      <PropertyRef Name="SQC_CAT_ID"/>
      <PropertyRef Name="SQC_USER_ID"/>
    </Key>
    <Property Name="SQC_CAT_ID" Type="int" Nullable="false" />
    <Property Name="SQC_USER_ID" Type="int" Nullable="false" />
    <Property Name="SQC_CAT_DSCR" Type="varchar" MaxLength="50" />
    <Property Name="SQC_SEQ_NO" Type="int" />
  </EntityType>

Nope, now the designer won’t open. Go back into the file, and Intellisense shows this error:

Error 11002: Entity Type ‘SAVED_QUERY_CATEGORY’ has no entity set.

Ok… Uncommenting created a new error. After adding an entity set:

<EntitySet Name="SAVED_QUERY_CATEGORY" EntityType="IssueModel.Store.SAVED_QUERY_CATEGORY" store:Type="Tables" Schema="dbo" />

Yay! The designer opens! Still not there yet, because while it shows up under the store’s Tables/Views folder, it has not Entity Type in the model. Can’t call it from my code. I don’t have any errors to work off though, so I tried creating an entity set mapping, but that results in the error “does not exist in MetadataWorkspace”.

So that’s what I have tried. How do I get this poorly designed table into my data model?

  • 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-23T11:45:09+00:00Added an answer on May 23, 2026 at 11:45 am

    By modifying XML you have only added information about database table. Now you have to open toolbox and add entity to your model in the designer. Configure the entity to have properties as you need. Then open mapping details and map the new entity to your table.

    Btw. once you modify the XML describing database manually you cannot use update from database anymore – VS designer will always delete your changes and you will have to do them again.

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

Sidebar

Related Questions

I have installed Visual Studio .NET 2005. But when I am trying to execute
I am trying to compile a program that is created from Visual Studio 8,
I have a Visual Studio 2010 solution that contains 3 projects: a dll project,
I have a Setup project that I have build using Visual Studio 2010. The
I am trying to build an ASP.NET project, but Visual Studio keeps giving me
So I have a Visual Studio 2010 project that uses external libraries and in
Visual Studio makes calling a web service easy, trying to figure out what is
I am new to vb.net (framework 4) and visual studio is giving me warnings
I have a ASP.NET solution in Visual Studio 2008 and I added a file
I have an issue with the DotNetOpenAuth sample projects. I have Visual Studio 2008,

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.