The ConnectionString property has not been initialized
<p>My connection string is placed in web.config as follows.</p>

<pre><code>&lt;connectionStrings&gt;
   &lt;add name="empcon" connectionString="Persist Security Info=False;User ID=sa;Password=abc;Initial Catalog=db5pmto8pm;Data Source=SOWMYA-3BBF60D0\SOWMYA" /&gt;
&lt;/connectionStrings&gt;
</code></pre>

<p>and the code of program is...</p>

<pre><code>public partial class empoperations : System.Web.UI.Page
{

    string constr = null;

    protected void Page_Load(object sender, EventArgs e)

    {
        ConfigurationManager.ConnectionStrings["empcon"].ToString();
         if (!this.IsPostBack)
        {
            fillemps();
        }
    }
    public void fillemps()
    {
        dlstemps.Items.Clear();
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["empcon"].ConnectionString);
        con.ConnectionString = constr;
        SqlCommand cmd = new SqlCommand();
        cmd.CommandText = "select * from emp";
        cmd.Connection = con;
        SqlDataReader reader;
        try
        {
            con.Open();
            reader = cmd.ExecuteReader();
            while (reader.Read())
            {
                ListItem lt = new ListItem();
                lt.Text = reader["ename"].ToString();
                lt.Value = reader["empno"].ToString();
                dlstemps.Items.Add(lt);
            }
            reader.Close();
        }
        catch (Exception er)
        {
            lblerror.Text = er.Message;
        }
        finally
        {
            con.Close();
        }        
</code></pre>

<p>i am totally new to programing....</p>

<p>i am able to run this application with er.message in label control as "the connection string property has not been initialized"</p>

<p>i need to retrieve the list of names of employees from the emp table in database into the dropdownlist and show them to the user...</p>

<p>can any one please fix it...</p>
