title: Multiple Column Chart From Database in C#
body: <p>I want to create a Multiple column chart on button click.
  Data for chart will come From Database.
  I have used following code. </p>
  
  <pre><code>protected void btnEffortProject_Click(object sender, EventArgs e)
  {
      string str = System.Configuration.ConfigurationManager.ConnectionStrings["DBConnection"].ToString();
      SqlConnection con = new SqlConnection(str);
      con.Open();
      SqlCommand cmd = new SqlCommand("Select Title, Planned_Estimate, TotalEffort from DBAgile.dbo.Project Where Status = 'Completed'", con);
      SqlDataAdapter sdp = new SqlDataAdapter(cmd);
      DataSet ds = new DataSet();
      sdp.Fill(ds);
  
      Chart1.DataSource = ds;
      Chart1.Series["Series1"].XValueMember = "Title";
      Chart1.Series["Series1"].YValueMembers = "Planned_Estimate";
      Chart1.Series["Series2"].XValueMember = "Title";
      Chart1.Series["Series2"].YValueMembers = "TotalEffort";
      Chart1.DataBind();
  }
  </code></pre>
  
  <p>aspx Code is as follows : </p>
  
  <pre><code>&lt;asp:Chart ID="Chart1" runat="server" Width="400px" Visible="False"&gt;
          &lt;Titles&gt;
              &lt;asp:Title ShadowOffset="3" Name="Items" /&gt;
          &lt;/Titles&gt;
          &lt;Legends&gt;
              &lt;asp:Legend Alignment="Center" Docking="Bottom" IsTextAutoFit="False" Name="Default"
                  LegendStyle="Row" /&gt;
          &lt;/Legends&gt;
          &lt;Series&gt;
              &lt;asp:Series Name="Series1" XValueMember="Title" YValueMembers="Planned_Estimate" LegendText="Quarter 1"
                  IsValueShownAsLabel="false" ChartArea="ChartArea1" MarkerBorderColor="#DBDBDB"&gt;
              &lt;/asp:Series&gt;
              &lt;asp:Series Name="Series2" XValueMember="Title" YValueMembers="TotalEffort" LegendText="Quarter 2"
                  IsValueShownAsLabel="false" ChartArea="ChartArea1" MarkerBorderColor="#DBDBDB"&gt;
              &lt;/asp:Series&gt;
          &lt;/Series&gt;
          &lt;ChartAreas&gt;
              &lt;asp:ChartArea Name="ChartArea1" BorderWidth="0" /&gt;
          &lt;/ChartAreas&gt;
      &lt;/asp:Chart&gt;
  </code></pre>
  
  <p>am i doing anything wrong ?? because code runs fine but doesn't display any chart.
  Where i am wrong ? Please Help</p>