using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AlfredoLotar.Livro.Aspnet.SchoolModel;
using System.Data.SqlClient;

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

    }
    protected void bntExecutar_Click(object sender, EventArgs e)
    {
        using (SchoolEntities contexto = new SchoolEntities())
        {
            var p = contexto.ExecuteStoreQuery<Person>("select * from Person where PersonID > {0}", 15);
            //var p = contexto.ExecuteStoreQuery<Person>("select * from Person where PersonID > @ID", new SqlParameter { ParameterName = "ID", Value = 15 });
            GridView1.DataSource=p;
            GridView1.DataBind();
        }
    }
}