I am trying to save the multiple selected Dates in sqlServer Database and retrieving from Database while page loading.
List
<DateTime> selectedDateList = new List<DateTime>();
/*Retrieving from RadCalender Selected Dates and saving to Database*/
for (int i = 0; i <RadCalendar1.SelectedDates.Count; i++)
{
selectedDateList[i].Date= RadCalendar1.SelectedDates[i].Date; // Getting error at this statement saying "Index was out of range. Must be non-negative and less than the size of the collection."
Saveto DataBase(selectedDateList);
}
/*Retrieving Data from Sql and loading into RadCalender*/
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
RadCalendar1.SelectedDates[i].Date =
Convert.ToDateTime(ds.Tables[0].Rows[i]["START_DATE"]); // Getting error at this statement saying "Index was out of range. Must be non-negative and less than the size of the collection."
}
Can anybody check and send me the solution please ASAP.