Its still not working. I have a form with the date and time fields which are drop down boxes and the code is as follows:
private void ddlTimeDataBinding()
{
string[] strHourList = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" };
ddlHrentered.DataSource = strHourList;
ddlHrentered.DataBind();
ddlHrShift.DataSource = strHourList;
ddlHrShift.DataBind();
string[] strMinuteList = { "00", "05", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55" };
ddlMinentred.DataSource = strMinuteList;
ddlMinentred.DataBind();
ddlMinShift.DataSource = strMinuteList;
ddlMinShift.DataBind();
}
private void ddlDateDataBinding()
{
string[] strMonthList = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" };
string[] strDayList = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" };
string strYear1 = DateTime.Now.Year.ToString();//Current year
int intYear = int.Parse(strYear1) - 1;
string strYear2 = intYear.ToString();//Last year
string[] strYearList = { strYear1, strYear2 };
ddlMonth.DataSource = strMonthList;
ddlMonth.DataBind();
ddlDay.DataSource = strDayList;
ddlDay.DataBind();
ddlYear.DataSource = strYearList;
ddlYear.DataBind();
ddlMonthReported.DataSource = strMonthList;
ddlMonthReported.DataBind();
ddlDayReported.DataSource = strDayList;
ddlDayReported.DataBind();
ddlYearReported.DataSource = strYearList;
ddlYearReported.DataBind(); }
I hope this gives u a better idea of my problem. I would be waiting for ur reply.