There can be situations where we have to use both windows authentication connections strings and SQL server authentication connection strings.

Approach Overview

for such situations, we can do an impersonation approach.

Example ConnectionStrings can place like the following

web.config code snippet

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 :)