下列范例利用DataGrid Web 控件显示CH08 目录中的Members 数据表,总共有37 笔记录:
<%@Import Namespace=System.Data.ADO%>
<%@Import Namespace=System.Data%>
<!--#Include File="GetTable.inc"-->
<Html>
<ASP:DataGrid Id="dgA" Runat="Server"/>
<Script Language="VB" Runat="Server">
Sub Page_Load(Sender As Object, e As EventArgs)
Dim dtDataTable As DataTable=GetTable("CH08\MyWeb.mdb", "Members")
dgA.DataSource=dtDataTable.DefaultView
Page.DataBind()
End Sub
</SCRIPT>
</Html>
文章来源于领测软件测试网 https://www.ltesting.net/