IF I look at your code, I suspect your code should be:
protected void ddlEmployeeID_SelectedIndexChanged(object sender, EventArgs e)
{
getEmployeeId();
try
{
string date = DateTime.Now.ToShortDateString();
string selectedDate = DatePicker.SelectedDate.ToShortDateString();
systemBusinessLayer = new BusinessLayer();
DataTable dt = new DataTable();
if (Page.IsPostBack && DatePicker.SelectedDate == DateTime.MinValue)
{
dt = systemBusinessLayer.getAllEmployeeAppointmentsByDate(date, Session["idnumber"].ToString());
}
else
{
dt = systemBusinessLayer.getAllEmployeeAppointmentsByDate(DatePicker.SelectedDate.ToShortDateString(), Session["idnumber"].ToString());
}
grdShowSelectedappointment.DataSource = dt;
grdShowSelectedappointment.DataBind();
}
catch (Exception error)
{
String exception == error.ToString();
}
}