If you need to store all of them in one config file, you can also do some indirection like this:
string name = ConfigurationManager.AppSettings["DB"]
string connStr = ConfigurationManager.ConnectionStrings[name].ConnectionString;
<configuration>
<appSettings>
<add key="DB" name="Prod" />
</appSettings>
<connectionStrings>
<add name="Prod" connectionString="..." />
<add name="Test" connectionString="..." />
<add name="Dev" connectionString="..." />
</connectionStrings>
</configuration>
It comes down to who can edit config in produciton and how you're allowed to deploy software. Sometimes this is a viable solution with the actual option to use being specified somewhere else altogether.