0

I have a simple calendar program: dates and notes are saved in database (first cell is Date and second is Note).
All noted days have bolded font in calendar.
But When I run program again all days have no-bolded font, no matter was it noted or not.
How can I fix this?

I tried to make something like this, but it didn't worked out.

foreach (DataRow row in database1DataSet.Tables[0].Rows)
{
    DateTime s_dt = Convert.ToDateTime(row[0].ToString());
    monthCalendar1.AddBoldedDate(s_dt);
}
monthCalendar1.UpdateBoldedDates();
Marius Bancila
  • 16,053
  • 9
  • 49
  • 91
Vito Karleone
  • 355
  • 1
  • 6
  • 17
  • Did you debug the program to make sure the dates (`s_dt`) are the corrected ones? – Marius Bancila May 20 '15 at 21:49
  • The problem is in s_dt. If I make something like DateTime sel_dt = new System.DateTime(int.Parse(textBox7.Text), int.Parse(textBox6.Text), int.Parse(textBox5.Text), 0, 0, 0, 0); monthCalendar1.UpdateBoldedDates(); But I have to get value not from text boxes. I have to take it from my DB by extracting Date values – Vito Karleone May 20 '15 at 21:57
  • Here is how you can read a DateTime from a data table: http://stackoverflow.com/questions/1106204/retrieving-a-datetime-value-from-a-datarow-c – Marius Bancila May 21 '15 at 08:55

0 Answers0