Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello. I developed a asp.net web site and it works on localhost. I can connect mssql with remote . Bu it writes Login failde for User 'sa'. I didn't write 'sa' to anywhere in my application. I don't know why i get this error.
Posted

You must have a connection string somewhere or else you can never access SQL. It is likely in your web.config.
 
Share this answer
 
Comments
enoua 25-Aug-14 10:17am    
Yes I have a connectionstring in web.config . Also i have a connectionstring in a class. But they are not for user sa .
ZurdoDev 25-Aug-14 10:20am    
Somewhere it is using sa. You'll have to find it. We can't see your code.
enoua 25-Aug-14 10:31am    
I developed my application on visual studio 2010 but my server is windows server 2003 (IIS6) is this problem ?
ZurdoDev 25-Aug-14 10:34am    
Shouldn't be. IIS will use the App pool identity if you specify Integrated Security in your connection string but that would also mean the app pool is using an account named SA which would be really weird.

Just trace it and see what line of code is throwing the error. Then find out where the connection string is getting set.

Or, just search for "SA" matching on whole words and see what it finds.
enoua 25-Aug-14 10:48am    
add name="websitesiConnectionString" connectionstring="Server=xx.xxx.xxx.xxx; Database=my_db_name;User ID=my_user_name;Password=my_password;" /add (I removed < and > tags)
here is my connectionstring . It works on remote connection from my localhost . But it gives me
Login failed for user 'sa'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'sa'.
It was a compatibility problem with framework, sql server 2008 R2 and windows server 2003. After installing windows server 2008 the problem was solved.
 
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