private void button1_Click(object sender, EventArgs e) { // <Snippet2> // Declare a variable to hold the contents of // textBox1 as an argument for the stored // procedure. string param = textBox1.Text; // Declare a variable to hold the results // returned by the stored procedure. var custquery = db.CustOrdersDetail(Convert.ToInt32(param)); // Execute the stored procedure and display the results. string msg = ""; foreach (CustOrdersDetailResult custOrdersDetail in custquery) { msg = msg + custOrdersDetail.ProductName + "\n"; } if (msg == "") { msg = "No results."; } MessageBox.Show(msg); // Clear the variables before continuing. param = ""; textBox1.Text = ""; // </Snippet2> }
private void button1_Click(object sender, EventArgs e) { string param = textBox1.Text; var custquery = db.CustOrdersDetail(Convert.ToInt32(param)); string msg = ""; foreach (CustOrdersDetailResult custOrdersDetail in custquery) { msg = msg + custOrdersDetail.ProductName + "\n"; } if (msg == "") { msg = "Нет результата."; } MessageBox.Show(msg); param = ""; textBox1.Text = ""; }
static void m6(string param) { var custquery = db.CustOrdersDetail(Convert.ToInt32(param)); // Execute the stored procedure and display the results. string msg = ""; foreach (CustOrdersDetailResult custOrdersDetail in custquery) { msg = msg + custOrdersDetail.ProductName + "\n"; } if (msg == "") { msg = "No results."; } Console.WriteLine(msg); }
private void button1_Click(object sender, EventArgs e) { string param = textBox1.Text; var custQuery = db.CustOrdersDetail(Convert.ToInt32(param)); string msg = ""; foreach (CustOrdersDetailResult custOrdersDetail in custQuery) { msg = msg + custOrdersDetail.ProductName + "\n"; } if (msg == "") { msg = "No results."; } MessageBox.Show(msg); // Clear the variables before continuing. param = ""; textBox1.Text = ""; }