Hi All Masters
This is my Second question and problem ...i have some code here
Sub SetLabels()
Call MySqlConnect()
Dim str As String
str = " Select * from room "
da = New MySqlDataAdapter(str, conn)
ds = New DataSet
da.Fill(ds, "room")
For i = 0 To ds.Tables("room").Rows.Count - 1
Dim newLabel As New Label
newLabel.Text = ds.Tables("room").Rows(i)("room_code")
newLabel.Name = newLabel.Text
newLabel.BorderStyle = BorderStyle.FixedSingle
newLabel.Size = New Drawing.Size(100, 100)
newLabel.Font = New Font("Tahoma", 15, FontStyle.Regular)
newLabel.TextAlign = ContentAlignment.TopCenter
newLabel.BackColor = Color.LightSkyBlue
If ds.Tables("room").Rows(i)("room_status") = "1" Then
newLabel.BackColor = Color.LightGreen
ElseIf ds.Tables("room").Rows(i)("room_status") = "2" Then
newLabel.BackColor = Color.Red
End If
Dim labels(i) As Label
labels(i) = newLabel
Me.Controls.Add(newLabel)
End Sub()
I put that code in Form_Load Event by Call SetLabels()...now my question is how to refresh labels for 5 Seconds with timer control if column "rooms_status" have a value or change value....
or my code has something wrong ....?
Please an advice or sample code for me....im newbie for this
Ps: I'm Using Visual Studio 2010 Express
In advance, thanks for any help.
Regards