Foreach loop through Datatable Column
<pre><code>OleDbConnection conn1 = new OleDbConnection();
conn1.ConnectionString = (@"ConnectionString");
conn1.Open();

DataTable dataTable = new DataTable();       

OleDbCommand cmd = new OleDbCommand(sqlstring, conn1); 

 foreach(DataRow row in dataTable.Rows)
 {
   MessageBox.Show(row["SerialNumber"].ToString());
 }
</code></pre>

<p>I am trying to get Serial Numbers from my database. I am not sure how to go about this. Am I suppose to reference my datatable somewhere within DataTable? I already set up the connection with my database. I want all the values in the column "SerialNumber" in my datatable "Warranty".</p>

<p>I believe a foreach is the right choice in this senario?</p>