title: Column 'tempValue' does not belong to table
body: <p>I currently have an error while coding for my pie chart using ajax tookit in visual studio 2010. I have been stuck here for almost 2 hours and could not find any solution. I've tried searching in this forum and tried a few but still having the same problem can anyone please help?</p>
  
  <pre><code>private void BindChart()
  {
      DataTable dt = new DataTable();
  
      string connstr = ConfigurationManager.ConnectionStrings["wkzdbConnectionString"].ConnectionString;
      SqlConnection conn = new SqlConnection(connstr);
      conn.Open();
  
      string query = "select count(case when tempValue &lt; 24 then 1 end), count(case when tempValue between 24 and 30 then 1 end), count(case when tempValue &gt; 30 then 1 end) FROM Datacentre";
      SqlDataAdapter da = new SqlDataAdapter(query, conn);
  
      DataSet ds = new DataSet();
  
      da.Fill(dt);
  
      string[] x = new string[] { "&lt; 24 Degrees", "24 - 30 Degrees", "&gt; 30 Degrees" };
  
      foreach (DataRow dr in dt.Rows)
      {
          PieChart1.PieChartValues.Add(new AjaxControlToolkit.PieChartValue
          {
              Category = x.ToString(),
              Data = Convert.ToDecimal(dr["tempValue"])
          }); //here is the error 'Column 'tempValue' does not belong to table'
      }
  }
  </code></pre>
  
  <p><strong>Here is my table:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/GKe0E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GKe0E.png" alt="Database Table"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ZIW3E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZIW3E.png" alt="enter image description here"></a></p>
  
  <p><strong>How my pie chart looks like:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/QNSzx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QNSzx.png" alt="enter image description here"></a></p>
  
  <p><strong>How i want it to look like:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Wi7Gj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wi7Gj.png" alt="enter image description here"></a></p>