Click here to Skip to main content
15,906,569 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to connect mvc5 to microsoft sql server
Posted
Comments
Member 11807858 2-Jul-15 3:51am    
tell me
ZurdoDev 2-Jul-15 7:09am    
It's very easy. Where exactly are you stuck?

1 solution

When you create a sample MVC 5 application it creates a sample aspNetDb with time stamp database in sql server.How ever most of the developer deletes the .MDF and associated database file from their solutions folder.In that case your actual database created in your sql server management studio and it didn't get delete.So in this case you first delete the sql server database and in your web.config reform the connection string with a desired database name and it will create roles,users tables for you.Now in compile time before running the application it creates a desired database for you and you can simply test by registering a user and authenticating for the same.

It's very simple.

Check the reference video's:

http://pluralsight.com/training/Player?author=scott-allen&name=aspdotnet-mvc5-fundamentals-m1-introduction&mode=live&clip=0&course=aspdotnet-mvc5-fundamentals[^]
 
Share this answer
 

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