I get his error at hnddate
(hidden field value coming from date time picker):
String was not recognized as a valid DateTime.when converting a string to datetime parse the string to take the date before putting each variable
DateTime weekStartDate = GetFirstDayOfWeek(Convert.ToDateTime(hdndate.Value))
.AddDays(0);
DateTime weekEndDate = weekStartDate.AddDays(14);
the query gets the startdate by comparing to a column in datatabse which is in 2014/04/28 and the datepicker (hnddate) has 28/04/2014 format.