Here Mudassar Ahmed Khan has explained how to programmatically add, modify (change) and update SQL connection strings at runtime in ASP.Net Web.Config file using C# and VB.Net.
He has explained how we can access and update the different attributes of a connection string like DataSource, IntitialCatalog, UserId, Password and IntegratedSecurity.