I have 2 connection strings in my web.config file, and I would like to select which one to use, from code.
Currently I have this:
asp:SqlDataSource ID="SqlDataSourceDelegateServices" runat="server"
ConnectionString="<%$ ConnectionStrings:HumanResourcesConnectionString %>" etc....
I tried removing the second line above, and instead putting this in my VB code:
SqlDataSourceDelegateServices.ConnectionString = "ConnectionStrings:HumanResourcesConnectionString"
but when I do a Select on the next line, I get: "Format of the initialization string does not conform to specification starting at index 0".
How can I set my connection string at run time, from code?
View Complete Post