Adding configuration file in a 3 tier architecture

1.Add a single app.config file in the UI Layer
<?xml version="1.0" encoding="utf-8" ?>

    <add key="Server1" value="" />
    <add key=" Server 2" value="" />

1.      Add the system.configuration dll refererence to the projetc where you want to access these values
using System.Configuration;
//access values using below code
String ipaddress= ConfigurationSettings.AppSettings.Get("MDT1");

1 comment: