Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Does anyone know any tutorials on how to deploy a mvc project that uses entity framwork to localhost. I watched the video tutorial made by pluralsight on asp.net web site, but the deployment seems to different with database first rather than code first.

My main questions are.

1. Where do i place my database?
2. What changes do i need to make to the following connection string

<add name="DbEntities" connectionString="metadata=res://*/Models.DatabaseEntities.Model.csdl|res://*/Models.DatabaseEntities.Model.ssdl|res://*/Models.DatabaseEntities.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLEXPRESS;attachdbfilename=C:\Databases\MyDb.mdf;integrated security=True;connect timeout=30;user instance=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
Posted

1 solution

Create you database in sql server by attaching mdf file. replace your database name with "your_db_name"

XML
<add name="DbEntities" connectionString="metadata=res://*/Models.DatabaseEntities.Model.csdl|res://*/Models.DatabaseEntities.Model.ssdl|res://*/Models.DatabaseEntities.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=localhost;Initial Catalog=your_db_name;Integrated Security=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
 
Share this answer
 
Comments
huotari 21-Jun-11 7:44am    
Thanks a lot

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900