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 are using SQL server authentication, you need 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 "/>
Tech Blog .


Shakir AliPosted Apr 1, 2019, 12:16 AM EDT
Very helpful thanks for sharing.
Ramya GowdaPosted Oct 11, 2018, 10:25 PM EDT
Getting timeout error if used windows authentication
Saritha K TPosted Jul 22, 2015, 10:10 PM EDT
Nice article
Rajeesh MenothPosted Jul 22, 2015, 9:31 PM EDT
Correct Mr Van Lai
Van LaiPosted Jul 22, 2015, 7:46 PM EDT
According to my experience, the views of blog in C#Corner is far lower than article. It is ok for short one.