mardi 23 février 2021

How to get Checklist box Items posted to SQL table

Working on a small project using WinForms to input data into a SQL DB. I have most of the fields working except the checklist Items box. The Checklist item box is populated with data from one table in the DB multi items can be selected and the need to be posted to a separate table in the same DB. Data is connected using EF6. I can get the code to post the value but not the selected text.

   (MedToxDatabaseEntities2 db = new MedToxDatabaseEntities2())
        {
            MedToxDatabaseSP.Patient patient = new Patient();

            // **** Patient Section of the main dashboard *****
            patient.EncounterDate = DateConsult.Value;
            patient.FirstName = TxbFirstName.Text;
            patient.LastName = TxbLastName.Text;
            patient.DOB = DOB.Value;
            string MRN = TxbMRN.Text;
            patient.PatientMedicalRecordNumber = Decimal.Parse(MRN);
            patient.ExposureName = CboExposure.Text;
            patient.InstitutionName = CboHospital.Text;
            patient.LocationName = CboHospitalLocation.Text;
            string Redcap = TxbRedCapNumber.Text;
            patient.RedcapNumber = Decimal.Parse(Redcap);


            // ****** Clinical Section of the dasbboard *******

            patient.ToxidromeName = CheckListToxidrome.SelectedValue.ToString();`



Aucun commentaire:

Enregistrer un commentaire