title: Vb.net pull in a SQL table row by row
body: <p>I am a little new to using vb.net and SQL so I figured I would check with you guys to see if what I am doing makes sense, or if there is a better way. For the first step I need to read in all the rows from a couple of tables and store the data in the way the code needs to see it. First I get a count:</p>
  
  <pre><code>mysqlCommand = New SQLCommand("SELECT COUNT(*) From TableName")
  Try
      SQLConnection.Open()
      count = myCommand.ExecuteScalar()
  Catch ex As SqlException
  
  Finally
      SQLConnection.Close()
  End Try
  
  Next
  </code></pre>
  
  <p>Now I just want to iterate through the rows, but I am having a hard time with two parts, First, I cannot figure out the SELECT statement that will jet me grab a particular row of the table. I saw the example here, <a href="https://stackoverflow.com/questions/16568/how-to-select-the-nth-row-in-a-sql-database-table">How to select the nth row in a SQL database table?</a>. However, this was how to do it in SQL only, but I was not sure how well that would translate over to a vb.net call.</p>
  
  <p>Second, in the above mycommand.ExecuteScalar() tell VB that we expect a number back from this. I believe the select statement will return a DataRow, but I do not know which Execute() statement tells the script to expect that.</p>
  
  <p>Thank you in advance.</p>