title: How can I generate the database from .edmx file in Entity Framework?
body: <p>I have had to suddenly switch to working on Code First Entity Framework 4.1. I started off not knowing anything about this framework but in the last 8 hrs I am now much more comfortable having read blogs and articles.</p>
  
  <p><a href="http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-model-amp-database-first-walkthrough.aspx" rel="noreferrer">This blog in particular</a> is one of the best blogs I have seen so far on the topic but the steps given do not match with my experience. In particular, I need more focus on the 3rd and 4th steps ('Create the Model' and 'Swap to DbContext Code Generation', respectively). I am unable to generate the database from my defined EntitySet. I am getting the SQL and I can execute but I'm getting the following error: </p>
  
  <pre><code>Could not locate entry in sysdatabases for "MyBD" database . No entry found with that name. Make sure that the name is entered correctly entity framework.
  </code></pre>
  
  <p>If I execute the SQL again, I get the same error following the names of tables that already exist in database.</p>
  
  <p>If refresh the DataConnection in Server Explorer, there are no such tables created as I defined in Entity Framework.</p>
  
  <p>How can I get rid of this error and successfully generate the tables in my .edmx? </p>
  
  <p>Also I am unable to find the option on right-click in Solution Explorer to "Generate Database" from selected class file that has the context class inherited from the DBContext object. I installed the Entity framework 4.1 from Microsoft, so it should appear there... How can I get the Generate Database option?</p>