Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

1 solution

Check your connection string: the chances are that your development and production SQL systems are different (and if they aren't, panic now!) and have been configured differently as regards the users they support. You will probably need to use different connection strings for the two systems, including log in details.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900