Ejemplo n.º 1
0
Archivo: Form1.cs Proyecto: wzchua/docs
        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>
        }
Ejemplo n.º 2
0
        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 = "";
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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 = "";
        }