AdBlock Detected

We provide high-quality source code for free. Please consider disabling your AdBlocker to support our work.

Buy me a Coffee

Saved Tutorials

No saved posts yet.

Press Enter to see all results

“Login failed for user” SQLConnection using C#

By pushpam abhishek
Listen to this article
“Login failed for user”  SQLConnection using C#

This is the Common Problem we are facing in Server DB Connection in Asp.net.If you are using windows authentication to connect to the Server DB, you need to set “Trusted_Connection=True;” if you're using SQL Server authentication, you would like to declare User “Id=myUsername; Password=myPassword;”




Code Snippet In Web.Config:

Windows authentication

<add name="windowsConnection" connectionString="Server=localhost; Database=databasename; Trusted_Connection=True;" />


SQL server authentication
<add name="Sqlserverconnection" connectionstring="server=localhost; Database=databasename;uid=db; password=123 "/> 

Do you know:-


If you like the tutorial, then please share this tutorial with your friends on social media.

Share this post

pushpam abhishek

About pushpam abhishek

Pushpam Abhishek is a Software & web developer and designer who specializes in back-end as well as front-end development. If you'd like to connect with him, follow him on Twitter as @pushpambhshk

Comments