using System;
using AlfredoLotar.Livro.Aspnet.SchoolModel;

public partial class ExecuteStoreQuery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnExecutar_Click(object sender, EventArgs e)
    {
        using (SchoolEntities contexto = new SchoolEntities())
        {
            /*foreach (var name in contexto.ExecuteStoreQuery<Person>
             ("Select * from Person where PersonID > {0}", 5))
             {
                 Response.Write(name.FirstName + " ");
                 Response.Write(name.LastName + "<br/>");
             }*/
            GridView1.DataSource = contexto.ExecuteStoreQuery<Person>
             ("Select * from Person where PersonID > {0}", 5);
            GridView1.DataBind();
        }
    }
}

