默认 MVC Web 应用程序数据库

发布于 2024-07-14 05:02:05 字数 340 浏览 7 评论 0原文

设置新的 ASP.NET MVC Web 应用程序时,Web.Config 中的默认连接字符串如下所示:

connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"

我只是想尝试一下登录和注册等,但当我运行应用程序时,它显然找不到 SQL 数据库。 我需要设置什么数据库和什么表才能执行此操作?

我的系统上安装了 SQL Server 2005 Standard,这足够吗?

谢谢。

When setting up a new ASP.NET MVC Web Application, the default connection string inside Web.Config is something like this:

connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"

I'm just wanting to play around with logging in and registering, etc but when I run the app it obviously can't find a SQL database. What database with what tables do I need to setup to do this?

I have SQL Server 2005 Standard installed on my system, is that enough?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半透明的墙 2024-07-21 05:02:05

SQL Server 2005 已经足够了。 默认连接字符串在 App_Data 文件夹中查找 SQL Server Express 文件。 将其替换为以下内容:

Data Source=<server name>;Initial Catalog=<database name>;User Id=<user name>;Password=<password>;

如果要生成 ASP.NET 成员资格表,请运行 aspnet_regsql.exe,该文件位于 .NET 2.0 Framework 文件夹中(例如 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727) 。 向导将指导您完成整个过程。

SQL Server 2005 is more than enough. The default connection string is looking for a SQL Server Express file in the App_Data folder. Replace it with the following:

Data Source=<server name>;Initial Catalog=<database name>;User Id=<user name>;Password=<password>;

If you want to generate the ASP.NET membership tables then run aspnet_regsql.exe, which is found in the .NET 2.0 framework folder (e.g. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727). A wizard will guide you through the process.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文