Posts Tagged ‘Configuration’

ConnectionString in App.config

In order to add a connection string to the app.config for a .Net application you only need the following websites:

E.g for connection to a SQL 2008 server:

< ?xml version="1.0" encoding="utf-8" ?>
    <clear />
    <add name ="Default" providerName ="System.Data.SqlClient"
    connectionString ="Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;"

However, you should not forget about security Securing Connection Strings.


Configuring a client endpoint

The followings are related (useful) articles (in addition to my notes) about configuring a WCF Client application:

MSDN Article 1: Client Configuration


The following shows the example in the MSDN article excluding all attributes and values. This configuration shows the overall structure of the xml elements.

<?xml version="1.0" encoding="utf-8"?>
          <endpoint >


//The behavior section references by the behaviorConfiguration endpoint attribute.


MSDN Article 2. Specifying an Endpoint Address

  • Each endpoint has a address associated to it. There are two ways to specify the address: In code and in the configuration file.
Categories: WCF Tags: , , , ,