How to remove a ConnectionString using Config Transformations

This will remove a specific connection string based on its name.

<configuration>
  <connectionStrings> 
    <add name="ConnStr2" xdt:Transform="Remove" xdt:Locator="Match(name)" connectionString=" " /> 
  </connectionStrings> 
</configuration>

Note that the connectionString value is not empty string, but is instead a space. Any non-empty value would do.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)