public static void PetLists(InquiryPet pets) { string pQuery = string.Format(@"SELECT ID AS PET_ID, (SELECT FIRST_NAME || ' ' || LAST_NAME FROM CUSTOMER WHERE ID = PET.OWNER_ID) AS CUSTOMER, NAME AS PETNAME, TO_CHAR(BIRTHDAY,'YYYY/MON/DD') as PET_BIRTHDAY from pet where owner_id in (select id from customer where lower(first_name||last_name) LIKE lower('%{0}%'))", pets.customerName); cmdString = new OracleCommand(pQuery, cntString); try { cntString.Open(); OracleDataAdapter da = new OracleDataAdapter(cmdString); DataTable dt = new DataTable(); DataSet ds = new DataSet(); da.Fill(dt); ds.Tables.Add(dt); pets.petList = ds.Tables[0]; } finally { cntString.Close(); } }
protected void check_Click(object sender, EventArgs e) { customerName = cusName.Text; InquiryPet pets = new InquiryPet(customerName, ownerID, petName, petBirthday, petList); try { ConnectionClass.PetLists(pets); petlisttable.DataSource = pets.petList; petlisttable.DataBind(); } finally { } }