title: Loop Through Specific Column Values in data table
body: <p>I have a winform app, in which i have a requirement read specific columns values specified by a condition.</p>
  
  <p>here is my C# code </p>
  
  <pre><code>SqlCommand anc = new SqlCommand(); ;
                  anc.Connection = ad;
                  string s = "Sixth";
                  anc.CommandText = "Select Sub_Name from Subs_Master where Semester =@Sixth ";
                  anc.Parameters.AddWithValue("@Sixth", s);
                  anc.ExecuteNonQuery();
                 // SqlDataReader anw = anc.ExecuteReader();
                  SqlDataAdapter al = new SqlDataAdapter(anc);
                  DataSet dts = new DataSet();
                  al.Fill(dts);
                  DataTable dt = dts.Tables[0];
                  dataGridView1.DataSource = dt;
                  label9.Text = "Sixth";
  
  
  foreach (DataRow drow in dt.Rows)
                  {
                  foreach (DataColumn Sub_Name in dt.Columns)
                  {
                      //
                      //{
                      radioButton3.Text = (drow[Sub_Name.ColumnName].ToString());
                      radioButton4.Text = (drow[Sub_Name.ColumnName].ToString());
                      radioButton5.Text = (drow[Sub_Name.ColumnName].ToString());
                      radioButton6.Text = (drow[Sub_Name.ColumnName].ToString());
                      radioButton7.Text = (drow[Sub_Name.ColumnName].ToString());
                      radioButton8.Text = (drow[Sub_Name.ColumnName].ToString());
  }
  </code></pre>
  
  <p>this is in referenace to a msdn walkthrough.</p>
  
  <p>here is my table in 
  <img src="https://i.stack.imgur.com/jQyL1.png" alt="data backend"></p>
  
  <p>Now my problem is that when i run it only the last value of that column i.e CA is displayed on all the radio box's but i want that each radio box should hold 6 different values e.g like radio3 should be Java, radio 4 should be CIMD, Radio 5 should Be Network..
  any way to do it? or is my query wrong.??</p>
  
  <p>thanks for your help in advance..</p>