I'm having some trouble here.
I got a DataTable from my database and I want to use it to be the datasource of my GridView.
The problem: when I set the datasource of this GridView with my DataTable, nothing happens. But if I set the datasource of another component (like ListItem), the data is shown.
What do I do with it? Follow the code below:
<!-- Here I have a ListView. When I set the datasource, the data is showed. -->
<asp:ListView ID="listviewCustomers" runat="server">
<ItemTemplate>
<asp:Label runat="server" ID="myLabel" text="<%# bind('Name') %>" />
</ItemTemplate>
</asp:ListView>
<!-- Here I have a GridView. When I set the datasource, nothing happens. -->
<asp:GridView runat="server" ID="gridviewPassageiros">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label runat="server" ID="myLabel" text="<%# bind('Name') %>" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>