【发布时间】:2012-11-01 07:36:56
【问题描述】:
我使用了 ASP.NET 的默认成员资格。格式化 PC 并安装 SQL Server Managment Studio 后,我运行应用程序,无法访问我的 ASPNETDB.MDF,但可以访问其他数据库。 例如,当我尝试注册时出现错误:
连接字符串是这样的:
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS; Integrated Security=SSPI; AttachDBFilename=|DataDirectory|aspnetdb.mdf; User Instance=true" providerName="System.Data.SqlClient"/>
如何访问 ASPNETDB.MDF?
【问题讨论】:
-
您正在尝试连接到 SQL Server 的
SQLEXPRESS实例 - 您是否安装了 SQL Server Express?如果不是:您需要在您拥有的 SQL Server 实例上创建您的ASPNETDB数据库(作为数据库,使用其逻辑数据库名称而不是物理文件名访问它) -
Mmm..我忘了安装SQL Server Express 2008。我现在正在安装它,然后会尝试,如果不能解决,请再说一遍。
-
谢谢,我安装了,然后就可以了
标签: asp.net-mvc asp.net-membership database-connection connection-string mdf