private void BtnSendRequest_Click(object sender, EventArgs e) { string un = this.GrdDoctorSchedule.CurrentRow.Cells["doctorname"].Value.ToString(); MessageBox.Show("Do you want take an appointment to" + un + "?"); dr.Userid = this.GrdDoctorSchedule.CurrentRow.Cells["doctorid"].Value.ToString(); dr.Date = this.GrdDoctorSchedule.CurrentRow.Cells["date"].Value.ToString(); dr.Time = this.GrdDoctorSchedule.CurrentRow.Cells["time"].Value.ToString(); cl.Userid = this.GrdDoctorSchedule.CurrentRow.Cells["clinicid"].Value.ToString(); cl.Username = this.GrdDoctorSchedule.CurrentRow.Cells["clinicname"].Value.ToString(); cl.Divission = this.GrdDoctorSchedule.CurrentRow.Cells["divission"].Value.ToString(); cl.District = this.GrdDoctorSchedule.CurrentRow.Cells["district"].Value.ToString(); cl.Thana = this.GrdDoctorSchedule.CurrentRow.Cells["thana"].Value.ToString(); prepo.AddtempReqAppoDocInfromation(pa, dr, cl); }