i am new in VB.net (about 3 weeks now) and i am using visual studio 2008 to make a reservation and billing program project.
i want to change the background color of the row having the entry which time (Day Swimming 8am-5pm, night swimming 4pm-11pm and overnight swimming 9pm-11pm) will be compared to current time.
to make it easier to understand i will give an example.
customer 1 enters the resort at 8am and will expire in 5pm.
my list view displays the customers information and the time that they entered but not the expiration time.
i want to automatically change the bgcolor of the row when the current time is 5pm (rows containing Day Swimming).
i want to compare the string DAY SWIMMING to current time is it posible?
but i cant seem to understand and find a way to make the bgcolor of the row to red that tells the user that this particular customer needs to be checked immediately for billing out.
somehow i managed to populate my listview with this codes and it is all i got for now.
Public Class frmCstmr
Private Sub refreshdata()
Dim conn As New OleDbConnection(MyConnString)
conn.Open()
Dim lst
ListView1.Items.Clear()
lst = New ListViewItem
Dim cmd As New OleDbCommand("Select * from Customer where status = 'checkedin'", conn)
Dim da As New OleDbDataAdapter(cmd)
Dim dataset As New DataSet()
da.Fill(dataset, "Customer")
For i = 0 To dataset.Tables("Customer").Rows.Count - 1
lst = ListView1.Items.Add(dataset.Tables("Customer").Rows(i).Item("ID").ToString)
lst.subitems.Add(dataset.Tables("Customer").Rows(i).Item("name").ToString)
lst.SubItems.Add(dataset.Tables("Customer").Rows(i).Item("cottage").ToString)
lst.SubItems.Add(dataset.Tables("Customer").Rows(i).Item("room").ToString)
lst.SubItems.Add(dataset.Tables("Customer").Rows(i).Item("time1").ToString)
lst.SubItems.Add(dataset.Tables("Customer").Rows(i).Item("adult").ToString)
lst.SubItems.Add(dataset.Tables("Customer").Rows(i).Item("kids").ToString)
lst.SubItems.Add(dataset.Tables("Customer").Rows(i).Item("seniorcitizen").ToString)
lst.SubItems.Add(dataset.Tables("Customer").Rows(i).Item("amount").ToString)
lst.SubItems.Add(dataset.Tables("Customer").Rows(i).Item("billingdate").ToString)
Next
conn.Close()
End Sub
thank you in advance.