What is AppSetting section in Web.Config file? - DOT.NET

What is AppSetting section in Web.Config file?

- The <appSettings> element of a web.config file where connection strings, server names, file paths, and other miscellaneous settings are stored.

- The items inside appSettings need to be configurable depending upon the environment.

- Web.config file defines configuration for a web project.

- AppSetting section is used to set the user defined values. For example: The ConnectionString which is used throughout the project for database connection.

- AppSetting section in the configuration file is a section that allows us to keep configurable and application wide settings (for example: ConnectionString) that an application requires in order to perform the tasks properly.

- This helps in easy maintenance and deployment of the application.

Syntax:
Web.confg:
<configuration>
<appsettings>
   <add key="ConnectionString" value="(your connection string)" />
</appsettings>
</configuration>

Code behind:
string strConnection = ConfigurationSettings.AppSettings["ConnectionString"];

Configuration File:
- This element can be used in the application configuration file, machine configuration file (Machine.config), and Web.config files that are not at the application directory level.

Example:
<configuration>
   <appSettings>
       <add key="Application Name" value="MyApplication" />
   </appSettings>
</configuration>

- It contains custom application settings.

- This is a predefined configuration section provided by the .NET framework.
What is Dataset object? - DOT.NET
DataSet object can not directly interact with Database. A DataAdapter object needs to be created to refer to the connection that is created....
What are the various objects in Dataset? - DOT.NET
The DataSet class exists in the System.Data namespace. The Classes contained in the DataSet class are:.....
How to save data from dataset? - DOT.NET
The modified data needs to be sent back to the database in order to save it...
Post your comment