Login failed for user 'sa'.

Hi Experts,

I know what the error means, I believe that I have done all that is necessary but where else can I look.  I am using dotnet to insert data into the db but it throws up the error above.


Data Source=DEV2;Initial Catalog=Estates;Integrated Security=False;Persist Security Info=True;User ID=sa;Password=***********;TrustServerCertificate=False;Context Connection=False

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Om PrakashCommented:
Is the sa password correct?
Can you login in the SSMS using the sa credentials
SirReadAlotAuthor Commented:
what is ssms?

in dotnet i tested that connection and it works
ssms is SQL Server Management studio....

Are you sure SA is not disabled?
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

SirReadAlotAuthor Commented:
Is the sa password correct?
Can you login in the SSMS using the sa credentials

yes it is correct.

where can i enable SA

You should check sa password from SSMS as seen in attached screenshot.
just make sure that password is valid.


Rajkumar GsSoftware EngineerCommented:
Is your full error message is like shown below ?
"Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection"

If so, try this

SirReadAlotAuthor Commented:

test2 is the full details of the error.

in test3, I have noticed that the current password (confirm password) is different from the one used in .net (password)

Rajkumar GsSoftware EngineerCommented:
To enable the SA account, execute this

ALTER LOGIN sa WITH PASSWORD = '<enterStrongPasswordHere>' ;

SirReadAlotAuthor Commented:

i have alter the password but still not luck
SirReadAlotAuthor Commented:
this is what i have in the appconfig

        <add name="DataAccessLayer.Properties.Settings.EstatesConnectionString"
            connectionString="Data Source=****;Initial Catalog=Estates;Persist Security Info=True;User ID=sa"
            providerName="System.Data.SqlClient" />
Anthony PerkinsCommented:
It looks like you are missing your password in your connection string.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SirReadAlotAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.