Day Rendering Calendar based on "Bookings" from MySQL table ASP.NET C#
I am trying to process results to change how the dates are displayed on the calander of an ASP.NET page. I want it so that if a "Booking" has been made on a particular date then it will show on the calendar as a red highligthed cell.
The problem is I am only managing to get it to do this once, it highlights one cell and then doesn't move onto the next "BookingDate".

Here is the Code:

    conn.Open();
                Reader = command.ExecuteReader();
                if (Reader.Read())
                {
                    String BookingDate = Reader.GetValue(0).ToString();
                    String Username = Reader.GetValue(1).ToString();
                    String Client = Reader.GetValue(2).ToString();
                    Reader.Close();
                    conn.Close();
                    String[] bookingDetails = new String[3];
                    bookingDetails[0] = BookingDate;
                    bookingDetails[1] = Username;
                    bookingDetails[2] = Client;
    
                    DateTime BookingDateShort = Convert.ToDateTime(BookingDate);
                    DateTime CalanderDate = Convert.ToDateTime(e.Day.Date);
                    
                    for (int i = 0; i < GetDaysinMonth(); i++)
                    {
                        if (CalanderDate.ToShortDateString().Equals(BookingDateShort.ToShortDateString()))
                        {
                            e.Cell.BackColor = System.Drawing.Color.Red;
                            e.Cell.ToolTip = "Username: " + Username + " | Client: " + Client + "";
                        }
                    }
                }

I am aware that I need to do some kind of loop to make it recursively go over this processing each date, comparing it against the bookingdate and checking whether they are equal. However It only does it for one booking date.

Does anyone see how I could fix this?

Many Thanks
Day Rendering Calendar based on "Bookings" from MySQL table ASP.NET C#
===

I am trying to process results to change how the dates are displayed on the calander of an ASP.NET page. I want it so that if a "Booking" has been made on a particular date then it will show on the calendar as a red highligthed cell.
The problem is I am only managing to get it to do this once, it highlights one cell and then doesn't move onto the next "BookingDate".

Here is the Code:

    conn.Open();
                Reader = command.ExecuteReader();
                if (Reader.Read())
                {
                    String BookingDate = Reader.GetValue(0).ToString();
                    String Username = Reader.GetValue(1).ToString();
                    String Client = Reader.GetValue(2).ToString();
                    Reader.Close();
                    conn.Close();
                    String[] bookingDetails = new String[3];
                    bookingDetails[0] = BookingDate;
                    bookingDetails[1] = Username;
                    bookingDetails[2] = Client;
    
                    DateTime BookingDateShort = Convert.ToDateTime(BookingDate);
                    DateTime CalanderDate = Convert.ToDateTime(e.Day.Date);
                    
                    for (int i = 0; i < GetDaysinMonth(); i++)
                    {
                        if (CalanderDate.ToShortDateString().Equals(BookingDateShort.ToShortDateString()))
                        {
                            e.Cell.BackColor = System.Drawing.Color.Red;
                            e.Cell.ToolTip = "Username: " + Username + " | Client: " + Client + "";
                        }
                    }
                }

I am aware that I need to do some kind of loop to make it recursively go over this processing each date, comparing it against the bookingdate and checking whether they are equal. However It only does it for one booking date.

Does anyone see how I could fix this?

Many Thanks