Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ACMEEntities db = new ACMEEntities();

            var customers = db.Customers;

            string result = "";

            foreach (var customer in customers)
            {
                result += "<p>" + customer.Name + "</p>";
            }

            resultLabel.Text = result;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ACMEEntities db        = new ACMEEntities();
            var          customers = db.Customers;
            string       result    = "";

            //foreach (var customer in customers)
            //{
            //    result += "<p>" + customer.Name + "</p>";
            //}

            customersGridView.DataSource = customers.ToList();
            customersGridView.DataBind();

            resultLabel.Text = result;
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ACMEEntities db = new ACMEEntities();
            var customers = db.Customers;

            string result = "";
            /*
            foreach (var customer in customers)
            {
                result += "<p>" + customer.Name + customer.Address + "</p>";
            }
            */

            customersGridView.DataSource = customers.ToList();
            customersGridView.DataBind();

            resultLabel.Text = result;
        }