Results 1 to 3 of 3
Thread: mvc database
Feb 28, 2011, 17:07 #1
- Join Date
- Jul 2008
- 0 Post(s)
- 0 Thread(s)
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/get...-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?
Feb 28, 2011, 17:41 #2
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.
Feb 28, 2011, 18:12 #3
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.
2) Added a connection string for your MovieDBContext:
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
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.