Database includes three major methods, Repeater, DataList, and DataGrid, which are directly or indirectly derived from the WebCo

xiaoxiao2021-03-06  79

Database includes three major methods, Repeater, DataList, and DataGrid, which are directly or indirectly derived from the WebControl base class in System.Web.ui.WebControls. These methods are content of data by HTML. First, the DataList Repeater control is a general iterative program, while the DataList control provides additional features specifically for control list layout. Unlike Repeater, DataList presents its template defining the table rows and cells around the element, providing a more rich layout and format setting function. For example, DataList supports the REPEATCOLUMNS and REPEATDIRECTION properties, which specifies the number of columns and data item rendering directions (vertical or horizontal). DataList also supports style features such as font size and font names. The following examples use VB.NET and C # two languages, respectively, how to access a SQL database containing the book name and other information, and use the DataList control to display relevant data.

[Vb.net] <% @ Import namespace = "system.data"%> <% @ Import name "=" system.data.sqlclient "%>