예제 #1
0
파일: Form1.cs 프로젝트: 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>
        }
예제 #2
0
파일: Form1.cs 프로젝트: OlgaLsh/coding
        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 = "";
        }
예제 #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);
        }
예제 #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 = "";
        }