'Strange problem in connecting MSSQL Server from ASP.NET API project
Don't know how to put this strange issue that I am facing. I have an ASP.NET API project which connects to a MSSQL Server database. Both reside at my local.
This is the connection string:
<connectionStrings>
<add name="xxxxx" connectionString="Data Source=localhost;Initial Catalog=dbname;uid=sa;Password=*****;Integrated Security=False" providerName="System.Data.SqlClient" />
</connectionStrings>
The problem is some endpoints are showing connection error while some are connecting fine and displaying records correctly. The error that I am receiving is:
{ "Message": "An error occurred while calling the XmanApi.Controllers.UnitModelController+d__1 method in d__1", "InnerException": "Login failed for user 'sa'." }
I checked the entire solution and made sure that all the endpoints are referring to the same connection string.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
