protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // store linkedlist items during the session //if (Session["mediitemlist"] == null && Session["mediitemqtylist"] == null && Session["mediitemidlist"] == null && Session["medarr"] == null && Session["medqtyarr"] == null && Session["medidarr"] == null) //{ Session["mediitemlist"] = new LinkedList <string>(); Session["mediitemqtylist"] = new LinkedList <string>(); Session["mediitemidlist"] = new LinkedList <string>(); Session["medarr"] = new string[] { }; Session["medqtyarr"] = new string[] { }; Session["medidarr"] = new string[] { }; //} // Display dropdownlist with Pet ID PetID Ids = new PetID(ids); MedList Meds = new MedList(mitems); try { ConnectionClass.PetIDList(Ids); PetIDList.DataSource = Ids.PetIDs; PetIDList.DataTextField = Ids.PetIDs.Columns["NNAME"].ToString(); PetIDList.DataValueField = Ids.PetIDs.Columns["ID"].ToString(); PetIDList.DataBind(); ConnectionClass.MedicationList(Meds); MedList.DataSource = Meds.MedItems; MedList.DataTextField = Meds.MedItems.Columns["NAME"].ToString(); MedList.DataValueField = Meds.MedItems.Columns["ID"].ToString(); MedList.DataBind(); } finally { } // Display Quantity Number for (int i = 1; i <= 100; i++) { InputQtyNum.Items.Add(new ListItem(i.ToString(), i.ToString())); } } }
public static void PetIDList(PetID ids) { string eQuery = string.Format(@"SELECT ID,(NAME || ', ID: ' || ID) AS NNAME from PET"); cmdString = new OracleCommand(eQuery, cntString); try { cntString.Open(); OracleDataAdapter da = new OracleDataAdapter(cmdString); DataTable dt = new DataTable(); DataSet ds = new DataSet(); da.Fill(dt); ds.Tables.Add(dt); ids.PetIDs = ds.Tables[0]; } finally { cntString.Close(); } }