2010-06-22 26 views
0

我很遗憾这是一个非常陈词滥调的问题,但我真的需要了解一些具体的事情。安装和配置asp.net 3.5数据库应用程序的sql服务器和IIS [基本]

每当我在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." 

如果我使用这种格式“服务器= \ SQLEXPRESS;数据库= XXX; Trusted_Connection =真“我得到

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管理工作室2008 R2中的数据库表达?我需要什么样的连接字符串,以及在SQL SERVER 2008 R2 Express IIS Windows Server 2003 R2上需要什么配置?

+0

添加详细信息...在管理工作室中创建SQL服务器登录并在连接字符串中使用它最终会导致“登录xxx失败”! – gideon 2010-06-22 17:29:27

回答

0

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

相关问题