static void m7(string param) { var custquery = db.CustOrderHist(param); string msg = ""; foreach (CustOrderHistResult custOrdHist in custquery) { msg = msg + custOrdHist.ProductName + "\n"; } Console.WriteLine(msg); }
private void button2_Click(object sender, EventArgs e) { string param = textBox2.Text; var custquery = db.CustOrderHist(param); string msg = ""; foreach (CustOrderHistResult custOrdHist in custquery) { msg = msg + custOrdHist.ProductName + "\n"; } MessageBox.Show(msg); param = ""; textBox2.Text = ""; }
private void button2_Click(object sender, EventArgs e) { // <Snippet3> // Comments in the code for button2 are the same // as for button1. string param = textBox2.Text; var custquery = db.CustOrderHist(param); string msg = ""; foreach (CustOrderHistResult custOrdHist in custquery) { msg = msg + custOrdHist.ProductName + "\n"; } MessageBox.Show(msg); param = ""; textBox2.Text = ""; // </Snippet3> }