title: Method improvement on data access via ADO.NET
body: <p>Which of the two code segments below would you prefer? Why? Are there any circumstances where the other would be preferable? Could you make any further improvements?</p>
  
  <pre><code> i. 
          private int GetSize(string deptName)
          {
              QueryHelper dqh = new QueryHelper();
              return dqh.GetDataSet("sp_GetDeptSize",deptName).Tables[0].Rows[0]["Size"];
          }
  
      ii. 
          private int GetSize(string deptName)
          {
              QueryHelper dqh = new QueryHelper();
              DataSet ds = dqh.GetDataSet("sp_GetDeptSize", deptName);
              DataTable dt = ds.Tables[0];
      DataRow dr = dt.Rows[0];
      int size = dr["Size"];
              return size;
          }
  </code></pre>
  
  <p>Please note that QueryHelper  is custom type.</p>
  
  <p>My answer to this:
  I prefer to method i, which is more concise. It seems that method ii is not preferable under any circumstances. </p>
  
  <p>I need advice on further improvement on method i, and idea would be very much appreciated.</p>