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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:11:04+00:00 2026-05-25T15:11:04+00:00

When generating a model from database in VS2010, I get my tables as entities,

  • 0

When generating a model from database in VS2010, I get my tables as entities, but the problem is that the foreign keys aren’t created.

I’ve been struggling with this for days now and just can’t seem to get it right. (I’ve got fair experience with MSSQL Server, but the client wants MySQL)

I’m using MySQL 5.1 and MySQL Workbench 5.2 to create my databases and tables. I use the InnoDB engine for all my tables as I read this supports foreign keys.

Next I’ve tried using MySQL Connector 6.4.3 (I think this is the latest one, not sure), dotConnect for MySQL, MySQL ODBC Connector 3.* with VS2010 sp1.

I’ve read allot of posts where people claim to get this working, then copy exactly what they propose in their blogs/posts, yet no foreign keys gets generated.

This is very frustrating as I install MySQL Connector (Earlier versions eg. 6.3.*) then uninstall it because a newer blog says this next version supports EF (O.O)…
And then it turns out I still don’t get my foreign keys.

Can anybody please shed some light on this? (I would greatly appreciate it.)

  • 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-25T15:11:04+00:00Added an answer on May 25, 2026 at 3:11 pm

    After 2 weeks of struggling I managed to get it right.

    See I assumed that if you create foreign key relations in the EER of MySQL, the tables get the foreign keys generated (though now I have a suspicion that only the tables in the model get this, and not the database tables themselves). You have to create the foreign keys on the tables yourself (Unlike MSSQL Server)…

    This was basically the problem. Though it’s sorted now.

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

Sidebar

Related Questions

I created model objects of from generating a scaffold, but now I want to
I'm trying to generate my database tables from my Entity Framework model, but I'm
When I'm generating/refreshing my model from the database, how do I specify which template
I'm generating models from my Mysql db. It generates a foreign key collection properly,
I'm just trying to right click then select "Generate Model from database." and I
When updating an EDMX model from the designer to add tables on a large
Is there any way to get dataanotations for my models directly from my database?
How can I make an Database Model edmx file that would let me add
When I am generating ADO.NET Entity Data Model from Northwind I am getting well-structured
I have a model that looks like this (well not really but it has

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.