Mvc database

hi all,

I’m new with asp and mvc. I’ve installed VS web developer 2010 express + mvc3 from ms web platform installer.

now I start with the tutorial on the official website :http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs

and i’ve installed the entity-framework for the Models. I chose to use the default db (app_data\spnetdb.mdf) , the one used for the membership/logon. so i’ve crate a new model and in my web.config there is:

connectionString=“metadata=res:///Models.Model1.csdl|res:///Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True"”

All works fine, i can insert and retrive data from my model, but i can’t see my new table in database explorer…there are only the mambership tables.

Where is my table?

There are several possible problem and we need more info.

By saying you installed Entity Framework, I am guessing you are talking about EF CTP5? Or are you using the EF4 designer that comes with 2010?

They handle db creation a tad differently.

Sorry for the double, but I just browsed the tutorial myself. Assuming you followed it step-by-step, here what you should’ve done (at various points in the demo):

  1. Downloaded and installed Sql Management Studio, as linked in the tutorial.
  1. Added a connection string for your MovieDBContext:

<configuration>
<connectionStrings>
<add name=“ApplicationServices”
connectionString=“data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true”
providerName=“System.Data.SqlClient” />
<add name=“MovieDBContext”
connectionString=“Server=.\SQLEXPRESS;
Database=Movies;Trusted_Connection=true

providerName=“System.Data.SqlClient” />
</connectionStrings>

This tells me your database will show up when you run Sql Management Studio and open the “Databases” folder in the explorer pane.

Let me know if you cannot find it.