I need to get all the appointments from my table for a particular patient, for this I tried like,
public List<Appoinment> GetAppoinments() //here Appointment is a class.
{
List<Appoinment> appointments = null;
foreach (DataObject.Appointment appointment in
dataEntities.Appointments.Where(a => a.PATIENTID == PatientId))
{
}
return appointments;
}
in my Appointment class and table, I’ve fields like PatientId, doctorid, appointment date, like this,
here, within the foreach loop I tried like,
appointments.add(appointment);
its thorwing error, it can’t convert automatically from database table appointments to class appointments, right.
I dunno how to do this, can anyone help me out here, thanks in advance
1 Answer