How to read from web.config?

You have to import System.Configuration

Lets say you have this in your web.config file:
[appSettings]
[add key="keyName" value="keyValue" /]
[/appSettings]

Retrieve it like this


using System.Configuration;

ConfigurationSettings.AppSettings["keyName"];

Comments

Popular posts from this blog

Singleton pattern implementation in C#

DataSet vs DataView