aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies Difference between appSettings and Connection Strings in web.config

Oct 10, 2012

In this article I will explain the differences between appsettings and connection strings in web.config using


In previous posts I explained Read or Write appsettings from web.config, Read/Write connection strings in web.config. Now I will explain differences between appsettings and connection strings in web.config using

In many cases, we need to use some data string throughout the application simple example for this database connection string. Instead of writing the same connection string wherever required, it is easy to maintain if we store it in one place that is web.config file.

In web.config file we can store the connection strings in two ways those are appSettings and connectionStrings

AppSettings in web.config

The AppSettings section in web.config is used to store connection strings, server names, file paths, and other miscellaneous settings needed by an application. (Read More)

Connection String in web.config

The connection string in web.config is a collection of database connection strings only.

Actually in previous versions of ASP.NET all connection string values are storing in appsettings only. In ASP.NET 2.0 + version new features has introduced such as Session, Membership, Personalization, and Role Manager these will depend on connection strings and stored in the connectionStrings element only. (Read More)


The main difference is in appsettings section we can store any data string values including database connection strings also but in connectionStrings section only database connection strings can store those are our application connection strings and new features (Membership, Personalization and Role Manager) connection strings only.

Instead of this there is no much difference between appsettings and connectionStrings.

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Anish yandrapragada said...

thank u very much for posting on my reply......

YUTHAM said...

Simple and good post...

Ursula Neal said...

The ConnectionStrings factor identifies a selection of data source relationship post, as name/value couples, for ASP.NET programs and functions.In past variations of ASP.NET, relationship post were saved in the appSettings.

divya said...

Thanks sir,this is very useful to .net beginners

spandana said...

thanks so much

TheLightNway said...

Thanks a lot

more said...

I will go back and check out your way.

Satyanarayana Kanakanala said...

in this page readmore in appsettin and configsettins is redirect to same page that is configsettings only

Rajesh Pathakoti said...

Simple ga Manta putinchav anna

kishore kumar.R said...

simple and superb....

sanjay said...
This comment has been removed by the author.
sanjay said...

Simple and easy to understand post

Give your Valuable Comments

Other Related Posts

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.