问题描述
我正在开发VS2012中的ASP.NET应用程序。项目使用 ASP.NET开发服务器&连接到其他服务器上的Sql Server 2008数据库。一切正常。我的经理指示我使用localhost IIS,而不是开发服务器。我简单地将Default站点的主目录指向项目的文件。
每当我访问站点http:// localhost /我收到错误时,连接到Sql Server [conn.Open( );]
System.ComponentModel.Win32Exception:登录失败:未知用户名或密码错误
同样开发机器,相同的项目,但如果我通过 ASP.NET开发服务器(http:// localhost:24573 / Web /)访问,它工作正常&能够连接到sql服务器。
请注意,连接字符串使用Sql Server凭据。
我读了一些有相同错误的文章,但是他们提到了Sql Server的FILESTREAM功能,而我没有使用任何这样的功能。即使如果在内部启用/使用这样的功能,那么,我很困惑,从同一台计算机,但不同的URL(一个IIS本地主机和其他ASP.NET开发服务器),为什么一个人能够连接&其他不能用吗?
有没有人可以指导我,有什么问题&怎么解决?在此先感谢
I'm working on ASP.NET application in VS2012. Project uses ASP.NET Development Server & connects to Sql Server 2008 database, which is on other server. Everything works fine. My manager instructed me to use localhost IIS, than development server. Simply I pointed the home directory of Default site to the files of the project.
Whenever I access the site http://localhost/ I receive the error, when connecting to Sql Server [conn.Open();]System.ComponentModel.Win32Exception: Logon failure: unknown user name or bad password
From the same development machine, same project, but if i access through ASP.NET Development Server (http://localhost:24573/Web/), it works fine & is able to connect to sql sever.
Note that connection string uses Sql Server credentials.
I read some articles with same error, but they are mentioning FILESTREAM feature of Sql Server, while I am not using any such feature. Even though if such feature is enabled/used internally, then, I am confused, from the same computer, but different URLs (one IIS local host & other ASP.NET Development Server), why one is able to connect & other is not able?
Is there anybody, who can guide me, what is the problem & how to fix it? Thanks in advance
推荐答案
这篇关于未知的用户名或密码错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!