declare connection string in web.config file using asp.net C#

If you are new to .net development and don't know how to declare connection string in web.config then you are at right place to learn a lot. In this article we show how to read write connection string in web.config file in asp.net. Before proceeding to our actual article subject we must know what is web.config? file and what is importance of web.config file in any asp.net application?

What is web.config?

Web.Config file is xml based configuration file which save and hold all main setting of asp.net application. You can declare Compilation Settings , database Connection Strings, page settings, custom error settings, security settings, session state configuration, HttpHandler settings, membership provider setting and much more. You can get more details from CodeProject Famous article Web.config File - ASP.NET

What is Connection String?

When you are working with dynamic website you must connect your asp.net application with database like mysql, sql server, ms access or any. You must have any bridge which connect each other. Connection String is small working part of ADO.Net which let you declare your database related information to connect with your Database. Connection String have Important information to establish connection with any Database.