title: adding the values of two lables
body: <p>I am trying to get this piece of code to work. I Cannot understand why it’s not working. Can somebody please have look and see if l'am doing something wrong here?</p>
  
  <p>The error message is </p>
  
  <blockquote>
    <p>"Input string was not in correct format"</p>
  </blockquote>
  
  <pre><code>sda = new SqlDataAdapter(@"SELECT salesT, SUM(CONVERT(DECIMAL(8,2),[salesA])) AS [A],
                             SUM(CONVERT(DECIMAL(8,2),[salesB])) AS [B], 
                             FROM details WHERE method= 'cont'  GROUP BY salesT", con);
  DataSet ds = new DataSet();
  sda.Fill(ds);
  DataRow dr = ds.Tables[0].Select("salesT= '01062015'").FirstOrDefault();
  
  if (dr != null)
  {
      label31.Text = dr["A"].ToString();
      label30.Text = dr["B"].ToString();
  }
  
  sda1 = new SqlDataAdapter(@"SELECT salesT, SUM(CONVERT(DECIMAL(8,2),[salesA])) AS [A], 
                              SUM(CONVERT(DECIMAL(8,2),[salesB])) AS [B], 
                              FROM details WHERE method= 'cred'  GROUP BY salesT", con);
  DataSet ds1 = new DataSet();
  sda1.Fill(ds1);
  DataRow dr1 = ds1.Tables[0].Select("salesT= '01062015'").FirstOrDefault();
  
  if (dr1 != null)
  {
      label22.Text = dr1["A"].ToString();
      label21.Text = dr1["B"].ToString();                            
  }
  
  int iV1 = Convert.ToInt32(label31.Text); 
  int iV2 = Convert.ToInt32(label22.Text);
  int iV3 = iV1 + iV2;
  label40.Text = iV3.ToString();
  </code></pre>