我正在使用mvc5 app ....我想使用sql server管理工作室数据库。我们可以做什么? [英] i am using mvc5 app....i want to use sql server management studio database.what can we do?

查看:76
本文介绍了我正在使用mvc5 app ....我想使用sql server管理工作室数据库。我们可以做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将mvc5连接到microsoft sql server

how to connect mvc5 to microsoft sql server

推荐答案

创建示例MVC 5应用程序时,它会在sql server中创建带有时间戳数据库的示例aspNetDb。如何大多数开发人员从他们的解决方案文件夹中删除.MDF和相关的数据库文件。在这种情况下,您的实际数据库在您的sql server管理工作室中创建并且它没有得到删除。所以在这种情况下您首先删除sql server数据库并且在你的web.config中改进了具有所需数据库名称的连接字符串,它将为你创建角色,用户表。现在在编译时,在运行应用程序之前,它为你创建了一个所需的数据库,你只需通过注册用户进行测试这是非常简单的。



查看参考视频:



http://pluralsight.com/training/Player?author=scott-allen&name=aspdotnet-mvc5-fundamentals-m1-introduction&mode = live& clip = 0& course = aspdotnet-mvc5-fundamentals [ ^ ]
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[^]


这篇关于我正在使用mvc5 app ....我想使用sql server管理工作室数据库。我们可以做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆