//Search for patient info (for now only based on SSN) AND only works with (retrieves) ONE patient private void Button1_Click(object sender, EventArgs e) { textSetFirstName.Text = ""; textSetLastName.Text = ""; textSetSSN.Text = ""; textSetAddress.Text = ""; textSetPhoneNumber.Text = ""; ConnectDB EMRDatabase = new ConnectDB(); dataGridView1.Rows.Clear(); if (!textPatientNameSearch.Text.Equals("")) //if searching by name { Patients = EMRDatabase.SelectByName(FirstName); //retrieve list by First Name } else { Patients = EMRDatabase.Select(SSN); //retrieve list by SSN } Fname = Patients[0]; Lname = Patients[1]; Birthday = Patients[2]; InsProvider = Patients[3]; Address = Patients[4]; Email = Patients[5]; Phone = Patients[6]; Sex = Patients[7]; PrimaryPhysician = Patients[8]; BloodType = Patients[9]; InsNumber = Patients[10]; Ssn = Patients[11]; for (int i = 0; i < Ssn.Count; i++) { dataGridView1.Rows.Add(Fname[i], Lname[i], Birthday[i], InsNumber[i]); } }