Connecting to DB with both Windows authentication and SQL Server authentication in .NET
There can be situations where we have to use both windows authentication connections strings and SQL server authentication connection strings.
for such situations, we can do an impersonation approach.
Example ConnectionStrings can place like the following
This is the Impersonate Class we can use for this
App settings values need set like the following for the Windows User.
So We have to update our source code on the Windows authentication access side like the following, SQL authentication side not require any upgrade.
Now we’ll be able to use both approaches :)