Bind dates from Database table to ASP.NET Calender
<p>I have been trying to implement <a href="http://msdn.microsoft.com/en-us/library/ms228044.aspx" rel="nofollow">this link</a></p>

<p>to  my basic ASP.NET calender but I really worried which method(s) do I use? I used this way and nothing works..</p>

<pre><code>public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            calendar1.VisibleDate = DateTime.Today;
            FillTrainingDataset();
        }

        protected DataSet dsTraining;


        protected void FillTrainingDataset()
        {
            DateTime firstDate = new DateTime(calendar1.VisibleDate.Year,
                calendar1.VisibleDate.Month, 1);
            DateTime lastDate = GetFirstDayOfNextMonth();
            dsTraining = GetCurrentMonthData(firstDate, lastDate);
        }

        protected DateTime GetFirstDayOfNextMonth()
        {
            int monthNumber, yearNumber;
            if (calendar1.VisibleDate.Month == 12)
            {
                monthNumber = 1;
                yearNumber = calendar1.VisibleDate.Year + 1;
            }
            else
            {
                monthNumber = calendar1.VisibleDate.Month + 1;
                yearNumber = calendar1.VisibleDate.Year;
            }
            DateTime lastDate = new DateTime(yearNumber, monthNumber, 1);
            return lastDate;
        } 

  protected DataSet GetCurrentMonthData(DateTime firstDate,
             DateTime lastDate)
{
    DataSet dsMonth = new DataSet();
    ConnectionStringSettings cs;
    cs = ConfigurationManager.ConnectionStrings["KKSTechConnectionString"];
    String connString = cs.ConnectionString;
    SqlConnection dbConnection = new SqlConnection(connString);
    String query;
    query = "SELECT StartDate, EndDate FROM Tentative_Orders";
    SqlCommand dbCommand = new SqlCommand(query, dbConnection);
    dbCommand.Parameters.Add(new SqlParameter("@StartDate", 
        firstDate));
    dbCommand.Parameters.Add(new SqlParameter("@EndDate", lastDate));

    SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(dbCommand);
    try
    {
        sqlDataAdapter.Fill(dsMonth);
    }
    catch {}
    return dsMonth;
}

        protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
        {
            DateTime nextDate;
            if (dsTraining != null)
            {
                foreach (DataRow dr in dsTraining.Tables[0].Rows)
                {
                    nextDate = (DateTime)dr["StartDate"];
                    if (nextDate == e.Day.Date)
                    {
                        e.Cell.BackColor = System.Drawing.Color.Pink;
                    }
                }
            }
        }
        protected void Calendar1_VisibleMonthChanged(object sender,
            MonthChangedEventArgs e)
        {
            FillTrainingDataset();
        }

    }
</code></pre>

<p>Is there any simple of way of creating method and rendering onto my Calender? This seems pretty long codes to me.. I expect my dates (Start and End) from my DB Table to appear on the Calender. </p>
