private void AttendanceBetweenDates_Search_Click(object sender, RoutedEventArgs e) { try { int ProjectID = int.Parse(txtPId.Text); DateTime FromDate = txtDateFrom.SelectedDate.Value; DateTime ToDate = txtDateTo.SelectedDate.Value; dgProjectAttendance.DataContext = attendanceBLL.LoadGridPABDBLL(ProjectID, FromDate, ToDate, LoginEntity.UserID); } catch (Exception ex) { Console.WriteLine(ex.Message ); } }