📄 show.aspx.vb
字号:
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
Protected WithEvents OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter
Protected WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents DataSet11 As show.DataSet1
Protected WithEvents DataView1 As System.Data.DataView
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection()
Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDataAdapter()
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand()
Me.DataSet11 = New show.DataSet1()
Me.DataView1 = New System.Data.DataView()
CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.DataView1, System.ComponentModel.ISupportInitialize).BeginInit()
'
'OleDbConnection1
'
Me.OleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=D:\alldotn" & _
"et\lyb\bin\lyb.mdb;Mode=Share Deny None;Extended Properties="""";Jet OLEDB:System " & _
"database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:" & _
"Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Op" & _
"s=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet " & _
"OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Do" & _
"n't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;" & _
"Jet OLEDB:SFP=False"
'
'OleDbDataAdapter1
'
Me.OleDbDataAdapter1.SelectCommand = Me.OleDbSelectCommand1
Me.OleDbDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "guestbook", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("biaoti", "biaoti"), New System.Data.Common.DataColumnMapping("Book_id", "Book_id"), New System.Data.Common.DataColumnMapping("content", "content"), New System.Data.Common.DataColumnMapping("Post_time", "Post_time"), New System.Data.Common.DataColumnMapping("username", "username")})})
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT biaoti, Book_id, content, Post_time, username FROM guestbook ORDER BY Book" & _
"_id DESC"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
'
'DataSet11
'
Me.DataSet11.DataSetName = "DataSet1"
Me.DataSet11.Locale = New System.Globalization.CultureInfo("zh-CN")
Me.DataSet11.Namespace = "http://www.tempuri.org/DataSet1.xsd"
'
'DataView1
'
Me.DataView1.Table = Me.DataSet11.guestbook
CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.DataView1, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
OleDbDataAdapter1.Fill(DataSet11)
If Not Page.IsPostBack Then
DataGrid1.CurrentPageIndex() = 0
DataGrid1.DataBind()
End If
End Sub
Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles DataGrid1.PageIndexChanged
DataGrid1.CurrentPageIndex = e.NewPageIndex
DataGrid1.DataBind()
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -