title: Best way to store the results of a query
body: <p>So I'm playing around a little with SQL and C#. I have a .cs file in which I have a method where I'm gonna use a select to get some info from my database.</p>
  
  <p>I think the syntax I'm using is correct (if not please let me know). But I was wondering which is the best way to store the result. Is there a way to store the result in datasets? If not, which is the best type to store the info?</p>
  
  <p>So here goes my code: </p>
  
  <pre><code>SqlConnection con = new SqlConnection();
          con.ConnectionString = (@"Data Source=XXXXXXXXXX.com;Initial Catalog=XXXXXXXXXX;User ID=XXXXXXXX;Password=XXXXXXXX");
  
          SqlCommand cmd = new SqlCommand();
          cmd.CommandText = "SELECT * FROM HISTHDR";
          cmd.CommandType = CommandType.Text;
  
          cmd.Connection = con;
  
          con.Open();
          int result = cmd.ExecuteNonQuery();
          con.Close();
  
          return true;
  </code></pre>
  
  <p>Thanks in advance!</p>