Components ASP.Net

<%--
Code revised from 
ASP.NET Tips & Techniques (Paperback)
by Greg Buczek 
# Publisher: McGraw-Hill/Osborne Media; 1st edition (May 21, 2002)
# Language: English
# ISBN: 0072225149
--%>         
       
       
<%@ Page Language=VB Debug=true %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OLEDB" %>

Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
    Dim DBConn as OleDbConnection
    Dim DBCommand As OleDbDataAdapter
    Dim DSPageData as New DataSet
    If Application("TipDate") <> Today() Then
        Application("TipDate") = Today()
        If Not Isnumeric(Application("TipNumber")) Then
            Application("TipNumber") = 1
        Else
            Application("TipNumber") = _
                Application("TipNumber") + 1
        End If
    End If
    DBConn = New OleDbConnection( _
        "PROVIDER=Microsoft.Jet.OLEDB.4.0;" _
        & "DATA SOURCE=" _
        & Server.MapPath _
        ("TipDB.mdb;"))
    DBCommand = New OleDbDataAdapter _
        ("Select TipTitle, TipText From Tips " _
        & "Where SequenceNumber = " _
        & Application("TipNumber"), DBConn)
    DBCommand.Fill(DSPageData, _
        "TheTip")
    If DSPageData.Tables("TheTip").Rows.Count = 0 Then
        Application("TipNumber") = 1
        DBCommand = New OleDbDataAdapter _
            ("Select TipTitle, TipText From Tips " _
            & "Where SequenceNumber = " _
            & Application("TipNumber"), DBConn)
        DBCommand.Fill(DSPageData, _
            "TheTip")
    End If
    lblTipTitle.Text = _
        DSPageData.Tables("TheTip").Rows(0). _
        Item("TipTitle")
    lblTipText.Text = _
        DSPageData.Tables("TheTip").Rows(0). _
        Item("TipText")
End Sub



Tip of the Day






    id="lblTitle" 
    font-size="12pt"
    font-bold="True"
    font-name="Lucida Console"
    runat="server"
    text="Current Tip of the Day"
/>



    id="lblTipTitle" 
    font-size="10pt"
    font-name="Lucida Console"
    runat="server"
/>


    id="lblTipText" 
    font-size="10pt"
    font-name="Lucida Console"
    runat="server"
/>



           
       
TipDB.zip( 8 k)