temTemplate>
<AlternatingItemTemplate>
<asp:Label ID="Label2" Runat=server Text=''''<%# DataBinder.Eval(Container.DataItem,"id").ToString() %>''''>
</asp:Label>
</AlternatingItemTemplate>
</asp:datalist></form>
</body>
</HTML>
Imports System
Imports System.Data
Imports System.Data.oledb
Public Class WebForm15Class WebForm15
Inherits System.Web.UI.Page
Web 窗体设计器生成的代码#Region " Web 窗体设计器生成的代码 "
''''该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()Sub InitializeComponent()
End Sub
Protected WithEvents DataList1 As System.Web.UI.WebControls.DataList
''''注意: 以下占位符声明是 Web 窗体设计器所必需的。
''''不要删除或移动它。
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init()Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
''''CODEGEN: 此方法调用是 Web 窗体设计器所必需的
''''不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Dim conn As OleDbConnection
Dim i As Integer
Private Sub Page_Load()Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
''''在此处放置初始化页的用户代码
conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("data/link.mdb"))
Dim cmd As New OleDbDataAdapter("select top 15 id,jj from link", conn)
Dim ds As New DataSet
cmd.Fill(ds, "tab")
DataList1.DataSource = ds.Tables("tab")
DataList1.DataBind()
End Sub
Private Sub Dat