I tried to use a command statement to count the numbers of events (group by day). And using if else statement to change the color of the cell, but when i run the page, all the event dates in in Green color. How can i change my code so that, different number of events has different color? Thank you in advance. string strConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; SqlConnection Conn = new SqlConnection(strConnectionString); string Command = "Select * FROM CaregiverBooking where CaregiverID='" + Label1.Text + "'"; SqlCommand cmd = new SqlCommand(Command, Conn); Conn.Open(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); ...

Go to the complete details ...