Member Avatar for b1izzard
b1izzard

Hi i had written the following code to Populate the Calendar Control with Data from an Access Table.[VS2008+MS-Access07]

Try
            Dim con As New OleDb.OleDbConnection
            Dim cmd As OleDbCommand
            Dim sql As String
            Dim dr As OleDbDataReader

            con.ConnectionString = _
            "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Resources\login.mdb"

            'open the connection
            con.Open()
            sql = "Select [Scheduled Date] From schedules"
            cmd = New OleDbCommand(sql, con)
            dr = cmd.ExecuteReader()
            If (dr.HasRows) = False Then
                Exit Sub
            Else
                While (dr.Read())
                    MonthCalendar1.AddBoldedDate(dr(0).ToString)
                    MonthCalendar1.UpdateBoldedDates()
                End While
            End If
            cmd = Nothing
            dr.Close()
            con.Close()
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical, Me.Text)
        End Try

The code works fine and it sets the bolded date based on the Access data from Access table but I need to display "Company name" when the user clicks the Bolded date. How can I do it?