protected void LinkButton1_Click(object sender, EventArgs e) { theOrder.add_foodItem(LinkButton1.Text); string pizza = theOrder.get_foodItem(); conn = new OleDbConnection(connString); //code that actually executes link conn.Open(); //and then opens it DateTime now = DateTime.Now; //DB Step 4: Execute the query OleDbCommand cmd = new OleDbCommand("INSERT INTO Items(ItemID, ItemName, ItemPrice, CustomerID) VALUES(' " + 456 + "','" + pizza + "','" + 45 + "','" + Session["pinNumber"] + "')", conn); cmd.ExecuteNonQuery(); //DB Step 5: Close Connection to DB conn.Close(); }
protected void LinkButton3_Click(object sender, EventArgs e) { theOrder.add_foodItem(LinkButton3.Text); Label2.Text = theOrder.get_foodItem(); }