SQL Server Express 用户实例和 ASP.net Web 应用程序项目 (dotnet nuke) 的问题

发布于 2024-09-03 15:35:36 字数 2711 浏览 7 评论 0原文

我正在尝试通过 DotnetNuke 连接到 SQL Express 2005。我的操作系统是 windows 7(IIS 7),当我尝试连接时出现以下错误:

尝试附加自动命名的 文件数据库(文件 位置).../Database.mdf 失败。一个 存在同名数据库,或者 指定的文件无法打开,或者 位于 UNC 共享上。

我已经尝试了在以下链接中找到的解决方案,但仍然遇到相同的错误。

http://support.microsoft.com/kb/2002980

然后我尝试更改我的 SQL服务器名称从 SYSTEMNAME\SQLEXPRESSSystemIP\SQLEXPRESS 我收到 DotNetNuke 错误,如下所示:

DotNetNuke 错误

System.ArgumentException:无效 键“attachdbfilename”的值。在 System.Data.SqlClient.SqlConnectionString.VerifyLocalHostAndFixup(String& 主机,布尔强制LocalHost, 布尔修正)位于 System.Data.SqlClient.SqlConnectionString..ctor(字符串 连接字符串)位于 System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(字符串 连接字符串、DbConnectionOptions 上一个)在 System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(字符串 连接字符串, 数据库连接池组选项 poolOptions、DbConnectionOptions& 用户连接选项)位于 System.Data.SqlClient.SqlConnection.ConnectionString_Set(字符串 值)在 System.Data.SqlClient.SqlConnection.set_ConnectionString(字符串 值)在 System.Data.SqlClient.SqlConnection..ctor(字符串 连接字符串)位于 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(字符串 连接字符串、命令类型 命令类型,字符串命令文本, SqlParameter[] 命令参数)位于 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(字符串 连接字符串、命令类型 命令类型,字符串命令文本)位于 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(字符串 连接字符串,字符串 spName, 对象[]参数值)位于 DotNetNuke.Data.SqlDataProvider.TestDatabaseConnection(DbConnectionStringBuilder 构建者、字符串所有者、字符串 预选赛)于 DotNetNuke.Services.Install.InstallWizard.TestDatabaseConnection() 在 DotNetNuke.Services.Install.InstallWizard.wizInstall_NextButtonClick(对象 发送者、WizardNavigationEventArgs e) 在 System.Web.UI.WebControls.Wizard.OnNextButtonClick(WizardNavigationEventArgs 吃 System.Web.UI.WebControls.Wizard.OnBubbleEvent(对象 来源,EventArgs e) at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(对象 来源,EventArgs args)位于 System.Web.UI.Control.RaiseBubbleEvent(对象 来源,EventArgs args)位于 System.Web.UI.WebControls.LinkBut​​ton.OnCommand(CommandEventArgs 吃 System.Web.UI.WebControls.LinkBut​​ton.RaisePostBackEvent(字符串 事件参数) at System.Web.UI.WebControls.LinkBut​​ton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String 事件参数) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler) 源控件,字符串事件参数) 在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection 发布数据)于 System.Web.UI.Page.ProcessRequestMain(布尔值 includeStagesBeforeAsyncPoint,布尔值 includeStagesAfterAsyncPoint)

任何人都可以帮我解决这个问题吗?

I am trying to connect to SQL Express 2005 through DotnetNuke. My OS is windows 7(IIS 7) and when i tried to connect i got the following error:

An attempt to attach an auto-named
database for file (file
location).../Database.mdf failed. A
database with the same name exists, or
specified file cannot be opened, or it
is located on UNC share.

I've tried the solution i found in the following link, but still i get the same error.

http://support.microsoft.com/kb/2002980

Then I tried to change my SQL Server name from SYSTEMNAME\SQLEXPRESS to SystemIP\SQLEXPRESS I get a DotNetNuke error as follows:

DotNetNuke Error

System.ArgumentException: Invalid
value for key 'attachdbfilename'. at
System.Data.SqlClient.SqlConnectionString.VerifyLocalHostAndFixup(String&
host, Boolean enforceLocalHost,
Boolean fixup) at
System.Data.SqlClient.SqlConnectionString..ctor(String
connectionString) at
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String
connectionString, DbConnectionOptions
previous) at
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String
connectionString,
DbConnectionPoolGroupOptions
poolOptions, DbConnectionOptions&
userConnectionOptions) at
System.Data.SqlClient.SqlConnection.ConnectionString_Set(String
value) at
System.Data.SqlClient.SqlConnection.set_ConnectionString(String
value) at
System.Data.SqlClient.SqlConnection..ctor(String
connectionString) at
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, CommandType
commandType, String commandText,
SqlParameter[] commandParameters) at
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, CommandType
commandType, String commandText) at
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName,
Object[] parameterValues) at
DotNetNuke.Data.SqlDataProvider.TestDatabaseConnection(DbConnectionStringBuilder
builder, String Owner, String
Qualifier) at
DotNetNuke.Services.Install.InstallWizard.TestDatabaseConnection()
at
DotNetNuke.Services.Install.InstallWizard.wizInstall_NextButtonClick(Object
sender, WizardNavigationEventArgs e)
at
System.Web.UI.WebControls.Wizard.OnNextButtonClick(WizardNavigationEventArgs
e) at
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object
source, EventArgs e) at
System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object
source, EventArgs args) at
System.Web.UI.Control.RaiseBubbleEvent(Object
source, EventArgs args) at
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs
e) at
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String
eventArgument) at
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
at
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData) at
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean
includeStagesAfterAsyncPoint)

can any one help me to solve this problem?

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

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

发布评论

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

评论(2

情泪▽动烟 2024-09-10 15:35:36

我在 IIS7 中尝试过此操作,它有效:

ApplicationPools->DefaultAppPool->Advanced Settings...Process Model 部分中,我设置了Identity 属性设置为 LocalSystemDotNetNuke 的首选设置是 NetworkService

LocalSystem 设置有效,因为代码将使用用于登录计算机的本地身份连接到 Sql Server。如果该登录名配置为 Sql Server 中的登录名,则这是必需的。我认为如果 Sql Server 登录/身份进行相应修改,NetworkService 设置也应该起作用(我还没有尝试过)。

I tried this in IIS7, and it worked:

In ApplicationPools->DefaultAppPool->Advanced Settings..., in the Process Model section, I set the Identity property to LocalSystem from the drop-down. The preferred setting for DotNetNuke is NetworkService.

The LocalSystem setting works because the code will connect to the Sql Server using the local identity that was used to log in to the machine. This is required if that login is configured as a login in Sql Server. I reckon if Sql Server logins/identities are modified accordingly, the NetworkService setting also should work (I haven't tried this).

就像说晚安 2024-09-10 15:35:36

遇到了类似的问题,发现我必须升级到 SQLExpress 2008R2,因为示例数据库位于 2008R2,而我只安装了 2008 Sp1

关键是另一条消息,“无法打开数据库C:\USERS\....\APP_DATA\ASPNETDB.MDF,因为它是版本661。此服务器支持版本 655 及更早版本不支持降级路径。”

Had a similar issue, found I had to upgrade to SQLExpress 2008R2 as the sample database was at 2008R2 and i only had 2008 Sp1 installed.

The key was another message, "The database C:\USERS\....\APP_DATA\ASPNETDB.MDF cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported."

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