title: How can i get the fastest perfomance on client system?
body: <p>How can i get fastest performance? I always use calculation on client application than making it in procedures. I got a table of about 10,000 rows to evaluate. The database is in a hosting web server and i've been reading all the rows and displaying in a datagrid in my application.</p>
  
  <p>So on my way reading columns 'ProductPrice' and 'ProductQty', I can calculate the ProductPrice * Qty and store it in another column within application, considering less data to be streamed over.</p>
  
  <p>Which of the following would be faster?</p>
  
  <pre><code>SqlCommand sqlCmdTxt = new SqlCommand(conn);
  SqlDataReader sqlRead;
  
  sqlCmdTxt.commandText = "Select ProductPrice, ProductQty, ProductPrice * ProductQty As Total From Stock";
  sqlRead = sqlCmdTxt.ExecuteReader();
  while (
  sqlRead.Read()) {
      double price = sqlRead.GetDouble(0);
      double qty = sqlRead.GetDouble(1);
      double sum = price * qty;
  
      dataGridView.rows.add (new object[] {price, qty, sum});
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>SqlCommand sqlCmdTxt = new SqlCommand(conn);
  DataSet dSet = new DataSet();
  new SqlDataAdapter(new SqlCommand("Select ProductPrice, ProductQty, ProductPrice * ProductQty As Total From Stock"
      , conn)).Fill(dSet, "StockList");
  dataGridView.DataSource = dSet.Tables["StockList"].DefaultView;
  </code></pre>