Do you avoid using duplicate connection string in web.config?

Last updated by Brady Stroud [SSW] 10 months ago.See history

Since we have many ways to use Connection String in .NET 2.0, it is probably that we are using duplicate connection string in web.config.

<connectionStrings>
    <add
        name="ConnectionString"
        connectionString="Server=(local);
        Database=NorthWind;"
    />
</connectionStrings>

<appSettings>
    <add key="ConnectionString" value="Server=(local);Database=NorthWind;"/>
</appSettings>

Bad example - Using duplicate connection string in web.config


Adam Cogan
Ryan Tee
We open source.Loving SSW Rules? Star us on GitHub. Star
Stand by... we're migrating this site to TinaCMS