See, that's the thing... I don't get any error at all, but I feel that I should. This is a very unique requirement. Although I agree with both of you that I should not be changing the value of the connection string, this situation calls for it. I'll give you more explanation of what I'm trying to do...
1. Load EntitySpaces settings explicitly in the code at startup (I have nothing in the config file). I add two connections, an EnterpriseDBConnection and a StoreDBConnection, however, for the store connection string I place something like this... "Integrated Security=SSPI;Initial Catalog=MyDatabase;Data Source=Server@STOREID" where @STOREID will be replaced at runtime by the store originating the call.
2. If my enterprise database is unavailable, or down, I need to call the store database on the store server from the originating call. However, in order to do so I need to replace the connnection string @STOREID with the actual store id, for example a store id of "A" would give me a connection string of "...Data Source=ServerA". I then flip the default connection to the StoreDBConnection.
3. Load my ES objects using the store connection.
Now I could load ALL of the store connections at startup, but there are a lot of stores and it seems overkill considering their connections strings, database schema, etc are all the same with the exception of the STORE ID. In theory this should work. I have created some tests without ES and had success. I've also been able to get this to work by hard coding the store server, for example, "ServerA", then flipping the connection. But again, I won't know which server to go to until runtime, so that won't work in production.
Again, the problem I'm having with ES is when I try to replace the @STOREID from the original connection string with the actual STORE ID. It seems that once the connection string is read, it can no longer be changed. Is there something that prohibits this in the get/set for the esConnectionElement.ConnectionString object/property? If so, it would be nice to get an exception stating that there was an error and the set could not be completed.
Thanks again for the help,
Matt