<%@ Page Language="VB" AutoEventWireup="false" CodeFile="insertrecord.aspx.vb" Inherits="insertrecord" %>
<%@ Import Namespace="system.data" %>
<%@ Import Namespace="system.data.oledb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="vbscript" type="text/vbscript" runat ="server">
Sub page_load(ByVal sender As Object, ByVal e As EventArgs)
Dim myconnection As OleDbConnection
Dim dataadaper As OleDbDataAdapter
Dim myset As DataSet
myconnection = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=" & "h:\asp.net\information.mdb")
dataadaper = New OleDbDataAdapter("select * from information", myconnection)
myconnection.Open()
myset = New DataSet
dataadaper.Fill(myset)
information.DataSource = myset
information.DataBind()
End Sub
Sub information_pageindexchanged(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs)
information.CurrentPageIndex = e.NewPageIndex
DataBind()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>无标题页</title>
</head>
<body bgcolor="#990000" style="text-align: center">
<form id="form1" runat="server">
<span style="font-weight: bold; font-size: x-large; color: #ffcc00">欢迎光临我的留言簿<br />
<asp:DataGrid runat="server"
CellPadding="3"
CellSpacing="0"
Font-Size="10pt"
HeaderStyle-BackColor="#aaaadd"
AlternatingItemStyle-BackColor="#eeeeee"
ID="information" AllowPaging="true" PageSize="3" ShowHeader="true" OnPageIndexChanged="information_pageindexchanged"/>
</span>
</form>
</body>
</html>