【文章內(nèi)容簡介】
k Protected WithEvents HyperLink3 As Protected WithEvents HyperLink4 As Protected WithEvents sel As 39。注意: 以下占位符聲明是 Web 窗體設(shè)計器所必需的。 39。不要刪除或移動它。 Private designerPlaceholderDeclaration As Private Sub Page_Init(ByVal sender As , ByVal e As ) Handles 39。CODEGEN: 此方法調(diào)用是 Web 窗體設(shè)計器所必需的 39。不要使用代碼編輯器修改它。 InitializeComponent() End SubEnd Region 39。定義每一頁顯示的記錄數(shù) Public Record_Per_Page As Short = 10 Private Script_Name As String 39。頁面加載 Public Sub Page_Load(ByVal Source As , ByVal e As ) Handles Script_Name = GetPageName() 39。第一種方式來分頁顯示數(shù)據(jù) ShowRecords() End Sub 39。得到起始瀏覽超鏈接字符串 Function GetPageName() As String Dim Str As String Dim Pos As Short Str = (Script_Name).Trim() Pos = (/) If Pos = 0 Then Return (Pos + 1) Else Return Str End If End Function 39。此函數(shù)的功能是分頁顯示數(shù)據(jù)庫中的記錄 Private Sub ShowRecords() Dim strConn As String 39。定義數(shù)據(jù)連接字符串 Dim SQL As String 39。定義SQL語句 Dim odConn As Dim odAdapt As Dim DS As DataSet 39。創(chuàng)建DataSet對象 Dim DT As DataTable 39。創(chuàng)建DataTable對象 Dim nRecCount As Integer 39。保存記錄總數(shù) Dim nPageCount As Integer 39。保存總共的數(shù)據(jù)頁面數(shù)目 Dim nPage As Integer 39。存放要瀏覽當前數(shù)據(jù)頁面號 Dim nStart As Integer 39。存放當前頁面的起始記錄序號 Dim nEnd As Integer 39。存放當前頁面的終止記錄序號 Dim I As Integer 39。確認要瀏覽的頁面序號 nPage = ((Page)) 39。(cint( ( Pagex ) )) If CInt((Pagex)) 0 Then Record_Per_Page = ((Pagex)) End If 39。=Record_Per_Page SQL = SELECT ,thename,picaddr,ttype,caption,ddate,content,reply,redate,homepage,qq, FROM leaveword,facesheet where faceid= order by desc 39。SQL = SELECT * FROM Leaveword 39。創(chuàng)建數(shù)據(jù)連接字符串 strConn = Provider = 。 amp。 _ Data Source = amp。 () amp。 。 amp。