【问题标题】:installing and configuring sql server and IIS for asp.net 3.5 database app [basic]为 asp.net 3.5 数据库应用程序安装和配置 sql server 和 IIS [基本]
【发布时间】:2010-06-22 16:45:29
【问题描述】:

很抱歉这是一个非常陈词滥调的问题,但我确实需要了解一些具体的事情。

每次我在 Visual Studio 2010 中添加一个 sql server 数据库时,它都会在 App_Data 下创建一个数据库,然后服务器资源管理器使用的连接字符串是一个具有指向该文件的 AttachDb 字段的连接字符串。

现在,当我在 2 台 IIS 服务器 6 和 7.5 上尝试时,我遇到了一系列错误,提示用户

"An attempt to attach an auto-named database for file XX failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."

如果我使用这种格式 "Server=\sqlexpress;Database=xxx;Trusted_Connection=True" 我得到 ​​p>

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.

我花了一整天的时间尝试各种不同的连接字符串、配置和组合!! =S

我的问题是:这样做的正确方法是什么?我应该在 sql management studio 2008 R2 express 中制作数据库吗?我需要什么样的连接字符串,在 SQL SERVER 2008 R2 Express IIS Windows Server 2003 R2 上需要什么样的配置?

【问题讨论】:

  • 添加细节...在 Management Studio 中创建 SQL Server 登录名并在连接字符串中使用它会导致“xxx 登录失败”!!

标签: asp.net iis connection-string sql-server-2008-express


【解决方案1】:

似乎我需要使用集成安全(Windows 身份验证)连接字符串,我还必须使用 localhost\sqlexpress 而不是 .\sqlexpress。对于 IIS 7.5,需要将应用程序池登录名添加到 sql 服务器登录名中!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多