title: How to have two columns with the same field but different values in a GridView
body: <p>I'm currently doing a project in ASP.NET/C# on where I have a GridView which gets two types of data from two different tables, ID and Initials.</p>
  
  <p>The table itself must be sort of like this:</p>
  
  <hr>
  
  <p>UNIT 1</p>
  
  <p>ID - INITIALS</p>
  
  <hr>
  
  <p>And a Column right next to it:</p>
  
  <hr>
  
  <p>UNIT 2</p>
  
  <p>ID - INITIALS</p>
  
  <hr>
  
  <p>The IDs are being called from Table 2, while the INITIALS are being called from Table 1. Each ID has it's own INITIALS, but my problem is that, since the INITIALS are being called twice, they repeat themselves on the following and previous Columns, as seen <a href="https://s21.postimg.org/4vvl79y0n/Capturar.png" rel="nofollow noreferrer">here</a>.</p>
  
  <p>My current code (ASPX):</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" CssClass= "table table-hover table-bordered" AllowPaging="false" PageSize="4" OnPageIndexChanging="OnPaging" OnPageIndexChanged="SearchByTagButton_Click" Style="max-width:75%;" AutoGenerateColumns="false"&gt;
                  &lt;Columns&gt;
                      &lt;asp:TemplateField HeaderText="UNIDADE" HeaderStyle-ForeColor="#B70700" HeaderStyle-Width="34%"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;%# DataBinder.Eval(Container.DataItem, "unidade")%&gt;
                              -
                              &lt;%# DataBinder.Eval(Container.DataItem, "sigUnidade")%&gt;
                          &lt;/ItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                      &lt;asp:TemplateField HeaderText="UNIDADE APOIADA" HeaderStyle-ForeColor="#B70700" HeaderStyle-Width="34%"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;%# DataBinder.Eval(Container.DataItem, "unidadeApoiada")%&gt;
                              -
                              &lt;%# DataBinder.Eval(Container.DataItem, "sigUnidade")%&gt;
                          &lt;/ItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                  &lt;/Columns&gt;
  </code></pre>
  
  <p>And C#:</p>
  
  <pre><code>SqlDataAdapter da;
      DataSet ds1 = new DataSet();
      DataSet ds2 = new DataSet();    
  SqlConnection conn = new SqlConnection(strConn);
  
      da = new SqlDataAdapter("SELECT ts.unidade, u.sigUnidade FROM T_SECRETARIAS ts INNER JOIN UNIDADES u on u.unidade = ts.unidade WHERE '%" + txtCodigoSearch.Text + "%' IS NULL OR LEN('%" + txtCodigoSearch.Text + "%') = 0 OR (ts.unidade='%" + txtCodigoSearch.Text + "%') OR ts.unidade LIKE '%" + txtCodigoSearch.Text + "%'", conn);
      da.Fill(ds1);
      da = new SqlDataAdapter("SELECT ts.unidadeApoiada, u.sigUnidade FROM T_SECRETARIAS ts INNER JOIN UNIDADES u on u.unidade = ts.unidadeApoiada WHERE '%" + txtCodigoSearch.Text + "%' IS NULL OR LEN('%" + txtCodigoSearch.Text + "%') = 0 OR (ts.unidadeApoiada='%" + txtCodigoSearch.Text + "%') OR ts.unidadeApoiada LIKE '%" + txtCodigoSearch.Text + "%'", conn);
      da.Fill(ds2);
      ds1.Merge(ds2);
      GridView1.DataSource = ds1;
      GridView1.DataBind();
  </code></pre>
  
  <p>I basically join two DataSets, one for each SQL Query, as I found it the only way to join both queries to get both ID's (they're different, as in they're all a "main ID" in Table 1, but in Table 2 they can also be "sub ID's".</p>
  
  <p>I tried to explain my best, but would like my table to be formatted as ID - INITIALS without any repetitions. If I could get any help, I'd be really appreciated.</p>