i am working in winforms with C#. heres my code
query = "SELECT max(Appointment_Time) FROM Appointments WHERE (Appointment_Status = 'D')";
dset = db.GetRecords(query,"Appointments");
ctime_Label.Text = dset.Tables["Appointments"].Rows[0]["Appointment_Time"].ToString();
db.GETRecords is a function of the class that provides me sql-services, simply returns me a dataset. i keep getting the error "the column 'Appointment_Time' doesnot belong to the table Appointments" which is stupid cuz
- when i am inserting the values its working fine.
- when i am NOT using max(Appointment_Time) function it is working fine
wha is the problem here.. i think there is something to do with the max() function. Any suggestion or alternative for this