ASP.NET(vb.net) & ListView Control
The ListView is represents a Windows list view control, which displays a collection of items that can be displayed using one of four different views. This example code can to Applied .NET Technology for ASP.NET 3.5 or later.
ListView Icon Control
This a sample create ListView and display the value from AccessDataSource.
Drag control ListView ASP.NET Web Form and Click ListView Tasks -> Choose Data Source -> <New data source…>
Choose a Data Source Type : Select Access Database and Specify an ID for the data source.
Choose a Database Path of Microsoft Access data file:
Configure the Select Statement.
Test Query and Click Finish
LayoutTemplate and ItemTemplate
<LayoutTemplate> <table> <tr> <td> <table id="Table1" runat="server" border="1"> <tr> <th id="Th1" runat="server"> CustomerID</th> <th id="Th2" runat="server"> Name</th> <th id="Th3" runat="server"> Email</th> <th id="Th4" runat="server"> CountryCode</th> <th id="Th5" runat="server"> Budget</th> <th id="Th6" runat="server"> Used</th> </tr> <tr ID="itemPlaceholder" runat="server"> </tr> </table> </td> </tr> </table> </LayoutTemplate> <ItemTemplate> <tr> <td> <asp:Label ID="lblCustomerID" runat="server" Text='<%# Eval("CustomerID") %>' /> </td> <td> <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>' /> </td> <td> <asp:Label ID="lblEmail" runat="server" Text='<%# Eval("Email") %>' /> </td> <td> <asp:Label ID="lblCountryCode" runat="server" Text='<%# Eval("CountryCode") %>' /> </td> <td> <asp:Label ID="lblBudget" runat="server" Text='<%# Eval("Budget") %>' /> </td> <td> <asp:Label ID="lblUsed" runat="server" Text='<%# Eval("Used") %>' /> </td> </tr> </ItemTemplate>
ddddddddddddddddd
.
.
.
Download this script.
.
.
.
Others related articles
ASP.NET(vb.net) & ListView - DataBind & DataSource
ASP.NET(vb.net) & ListView - SeparatorTemplate
ASP.NET(vb.net) & ListView - AlternatingItemTemplate
ASP.NET(vb.net) & ListView - DataBound
ASP.NET(vb.net) & ListView - XML
ASP.NET(vb.net) & ListView - DataSet,DataTable,TableRow
ASP.NET(vb.net) & ListView - FindControl
ASP.NET(vb.net) & ListView - Visual Studio 2008,2010 (Fx 3.5,4.0)
ASP.NET(vb.net) & ListView - Microsoft Access (.mdb) - System.Data.OleDb
ASP.NET(vb.net) & ListView - SQL Server 2000,2005,2008 - System.Data.SqlClient
ASP.NET(vb.net) & ListView - MySQL Database - MySql.Data.MySqlClient
ASP.NET(vb.net) & ListView - Oracle Database - System.Data.OracleClient