I\'m trying to write Connection string to Web.config like this:
Add reference to add System.Configuration:-
System.Configuration
System.Configuration.ConfigurationManager. ConnectionStrings["connectionStringName"].ConnectionString;
Also you can change the WebConfig file to include the provider name:-