Hi,
I'm trying to do a school schedule with a Table Panel Layout, and i'm having some difficults.


This is the code i have so far:

TableLayoutPanel1.ColumnCount = 7
        TableLayoutPanel1.RowCount = 2
        TableLayoutPanel1.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single

        Dim label_seg As New Label()
        label_seg.Location = New Point(10, 10)
        label_seg.Text = "Monday"
        label_seg.Size = New Size(100, 30)
        TableLayoutPanel1.Controls.Add(label_seg, 1, 0)
        Controls.Add(TableLayoutPanel1)


        Dim label_ter As New Label()
        label_ter.Location = New Point(10, 20)
        label_ter.Text = "Tuesday"
        label_ter.Size = New Size(100, 30)
        TableLayoutPanel1.Controls.Add(label_ter, 2, 0)
        Controls.Add(TableLayoutPanel1)


        Dim label_qua As New Label()
        label_qua.Location = New Point(10, 20)
        label_qua.Text = "Wednesday"
        label_qua.Size = New Size(100, 30)
        TableLayoutPanel1.Controls.Add(label_qua, 3, 0)
        Controls.Add(TableLayoutPanel1)


        Dim label_qui As New Label()
        label_qui.Location = New Point(10, 20)
        label_qui.Text = "Thursday"
        label_qui.Size = New Size(100, 30)
        TableLayoutPanel1.Controls.Add(label_qui, 4, 0)
        Controls.Add(TableLayoutPanel1)


        Dim label_sex As New Label()
        label_sex.Location = New Point(10, 20)
        label_sex.Text = "Friday"
        label_sex.Size = New Size(100, 30)
        TableLayoutPanel1.Controls.Add(label_sex, 5, 0)
        Controls.Add(TableLayoutPanel1)


        Dim label_sab As New Label()
        label_sab.Location = New Point(10, 20)
        label_sab.Text = "Saturday"
        label_sab.Size = New Size(100, 30)
        TableLayoutPanel1.Controls.Add(label_sab, 6, 0)
        Controls.Add(TableLayoutPanel1)

Now i want to search the DB with the hours, in the tempos_letivos table (begin:08h; end: 09h), then search for classes that have the day of the week and hours in common, if there is it writes the Professor and the Course.

Here are thables, so you can understand better:

PROFS
cod_prof
nome_prof
email_prof
cod_curso

CURSOS
cod_curso
nome_curso
nro_max_aluno
imagem_curso
prog_curso

HORARIOS
cod_horario
hora_inicial
hora_final
dia_semana
cod_prof
copd_curso

TEMPOS LETIVOS
cod_tempo
hora_inicio
hora_fim

Can someone help me?

Thank you,
PF2G

This has Nothing to do with your question, though I hope it helps.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With TableLayoutPanel1
            .ColumnCount = 7 : .RowCount = 2 : .CellBorderStyle = TableLayoutPanelCellBorderStyle.Single
        End With
        addLabel("Monday", 1)
        addLabel("Tuesday", 2)
        addLabel("Wednesday", 3)
        addLabel("Thursday", 4)
        addLabel("Friday", 5)
        addLabel("Saturday", 6)
    End Sub
    Private Sub addLabel(ByVal dayOfWeek As String, ByVal columnIndex As Integer)
        TableLayoutPanel1.Controls.Add(New Label With {.Text = dayOfWeek, .Location = New Point(10, 20), .Size = New Size(100, 30)}, columnIndex, 0)
        'Controls.Add(TableLayoutPanel1)
    End Sub

Since I do not bother with db(database), I have no idea how to search it, though I do believe that you should advise which db you are using; if SQL, Access, etc..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.