title: Query returning Count of rows and assigning to Int variable
body: <p>Im selecting the count of how many rows in my query. I need to assign that to a int variable. How would I accomplish this?</p>
  
  <p>Display.aspx.cs</p>
  
  <pre><code>            **int TotalYesVotes;**
              Ratings GetYesVotes = new Ratings();
              DataTable DATotalYesVotes = GetYesVotes.GetTotalYesVotes();
              **//How do i assign that count to TotalYesVotes**
  </code></pre>
  
  <p>Business layer</p>
  
  <pre><code>     public DataTable GetTotalYesVotes()
       {
  
           DLRatings DlTotalyesVotes = new DLRatings();
           return DlTotalyesVotes.GetTotalYesVotes();
  
       }
  </code></pre>
  
  <p>My data layer</p>
  
  <pre><code>    public DataTable GetTotalNoVotes()
      {
          //get database connection string from config file
          string strConectionString o= ConfigurationManager.AppSettings["DataBaseConnection"];
  
          //set up sql
          string StrSql = "SELECT COUNT(*) AS Expr1 FROM Ratings WHERE (PicRating = 2) AND (PicID = 2)";
  
          DataTable dt = new DataTable();
          using (SqlDataAdapter daObj = new SqlDataAdapter(StrSql, strConectionString))
          {
  
              //fill data table
              daObj.Fill(dt);
          }
          return dt;
          }
  </code></pre>