title: how to use table adapter to bind with asp gridview?
body: <p>i am trying to bind my grid to table adapter data, this is what i do :</p>
  
  <pre><code>DataSourceDepartement dpt = new DataSourceDepartement();
  
  DataSourceDepartementTableAdapters.departementTableAdapter
           adapter = new DataSourceDepartementTableAdapters.departementTableAdapter();
  gridDepartement.DataSource = adapter.GetDataDepartement();
  gridDepartement.DataBind();
  </code></pre>
  
  <p>aspx file :</p>
  
  <pre><code>&lt;asp:GridView ID="gridDepartement" runat="server" CellPadding="4" ForeColor="Black" 
                      GridLines="Horizontal" AutoGenerateColumns="False" BackColor="White" 
                      BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" AllowSorting="true"&gt;
                      &lt;Columns&gt;
                          &lt;asp:TemplateField ItemStyle-Width="20px"&gt;
                              &lt;ItemTemplate&gt;
                                  &lt;asp:CheckBox Id="cbSelect" runat="server"/&gt;
                              &lt;/ItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;          
                          &lt;asp:CommandField ShowEditButton="True" ItemStyle-Width="20px" /&gt;
                          &lt;asp:CommandField ShowDeleteButton="True" ItemStyle-Width="20px" /&gt;
                          &lt;asp:TemplateField HeaderText="Departement Code"&gt;
                              &lt;ItemTemplate&gt;
                                  &lt;asp:label runat="server" ID="departementcode" &gt;&lt;/asp:label&gt;
                              &lt;/ItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
                      &lt;/Columns&gt;
                      &lt;FooterStyle BackColor="#CCCC99" ForeColor="Black" /&gt;
                      &lt;HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" /&gt;
                      &lt;PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" /&gt;
                      &lt;SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" /&gt;
                  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>but somehow, my gridview does not show its data, what i miss?</p>