title: How to populate two separate repeaters with distinct column name and the value corresponding to the column
body: <p>How to populate a repeater with two separate list</p>
  
  <p>I have the following repeater:</p>
  
  <pre><code>&lt;div style="width: 100%; overflow: hidden;"&gt;
      &lt;asp:Repeater ID="rptLabels" runat="server" ClientIDMode="Static"&gt;
          &lt;HeaderTemplate&gt;
              &lt;div class="hidOverflow setFloatL smallPadLeft" style="width: 45%; float: left;"&gt;
  
          &lt;/HeaderTemplate&gt;
          &lt;ItemTemplate&gt;
                  &lt;div class="hidOverflow smallPad"&gt;
                      &lt;div class="setFloatL halfWidth vertAlignT"&gt;
                          &lt;asp:Label ID="lbl1" ClientIDMode="Static" runat="server" Text="&lt;%# Container.DataItem.ToString() %&gt;"&gt;&lt;/asp:Label&gt;
                      &lt;/div&gt;
                      &lt;div class="setFloatL vertAlignT"&gt;
                          &lt;asp:Label ID="lbl2" ClientIDMode="Static" runat="server" Text="&lt;%# Container.DataItem.ToString() %&gt;"&gt;&lt;/asp:Label&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
          &lt;/ItemTemplate&gt;
          &lt;FooterTemplate&gt;
              &lt;/div&gt;
          &lt;/FooterTemplate&gt;
      &lt;/asp:Repeater&gt;
      &lt;asp:Repeater ID="rptLabels2" runat="server" ClientIDMode="Static"&gt;
          &lt;HeaderTemplate&gt;
              &lt;div class="hidOverflow setFloatL smallPadLeft" style="width: 45%; float: left;"&gt;
  
          &lt;/HeaderTemplate&gt;
          &lt;ItemTemplate&gt;
                  &lt;div class="hidOverflow smallPad"&gt;
                      &lt;div class="setFloatL halfWidth vertAlignT"&gt;
                          &lt;asp:Label ID="lbl3" ClientIDMode="Static" runat="server" Text="&lt;%# Container.DataItem.ToString() %&gt;"&gt;&lt;/asp:Label&gt;
                      &lt;/div&gt;
                      &lt;div class="setFloatL vertAlignT"&gt;
                          &lt;asp:Label ID="lbl4" ClientIDMode="Static" runat="server" Text="&lt;%# Container.DataItem.ToString() %&gt;"&gt;&lt;/asp:Label&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
          &lt;/ItemTemplate&gt;
          &lt;FooterTemplate&gt;
              &lt;/div&gt;
          &lt;/FooterTemplate&gt;
      &lt;/asp:Repeater&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I am trying to populate the column name into each <code>lbl1</code> and the row value of the corresponding column into each <code>lbl2</code>. I have the following code:</p>
  
  <pre><code>List&lt;string&gt; colO = new List&lt;string&gt;();
  List&lt;string&gt; colOV = new List&lt;string&gt;();
  List&lt;string&gt; colT = new List&lt;string&gt;();
  List&lt;string&gt; colTV = new List&lt;string&gt;();
  
  using (SqlConnection conn = new SqlConnection(gloString))
  {
  
      string strQuery = @""; //query which generates the dataset
  
      try
      {
          SqlDataAdapter da = new SqlDataAdapter(strQuery, conn);
  
          DataSet myDataSet = new DataSet();
          da.Fill(myDataSet);
  
  
          DataTable myDataTable = new DataTable();
          myDataTable = myDataSet.Tables[0];
  
          for (i = 0; i &lt; myDataSet.Tables[0].Columns.Count / 2; i++)
          {
              lop += myDataSet.Tables[0].Columns[i].ColumnName + " ";
              colO.Add(myDataSet.Tables[0].Columns[i].ColumnName.ToString()); //column name
              colOV.Add(myDataSet.Tables[0].Rows[0][i].ToString()); //row value of the column
          }
          lop += "\n\n";
          for (int j = i; j &lt; myDataSet.Tables[0].Columns.Count; j++)
          {
              lop += myDataSet.Tables[0].Columns[j].ColumnName + " ";
              colT.Add(myDataSet.Tables[0].Columns[j].ColumnName.ToString()); //column name
              colTV.Add(myDataSet.Tables[0].Rows[0][j].ToString()); //row value of the column
          }
  
          rptLabels.DataSource = colO; //I would like to popupate "colO" into "lbl1" and "colOV" into "lbl2" inside "rptLabels" repeater
          rptLabels.DataBind();
  
          rptLabels2.DataSource = colT; //I would like to popupate "colT" into "lbl3" and "colTV" into "lbl4" inside "rptLabels2" repeater
          rptLabels2.DataBind();
      }
      catch (SqlException)
      {
      }
  }
  </code></pre>
  
  <p>Right now I can only use one list for the datasource for each repeater. How can I modify the code to achieve the following:</p>
  
  <pre><code>rptLabels.DataSource = colO; //I would like to popupate "colO" into "lbl1" and "colOV" into "lbl2" inside "rptLabels" repeater
  rptLabels.DataBind();
  
  rptLabels2.DataSource = colT; //I would like to popupate "colT" into "lbl3" and "colTV" into "lbl4" inside "rptLabels2" repeater
  rptLabels2.DataBind();
  </code></pre>