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.Objects;
using System.Data.SqlClient;
using System.Data;

public partial class StoredProcedures1 : 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())
        {
            try
            {
                ObjectParameter nome = new ObjectParameter("Name", typeof(String));
                contexto.GetDepartmentName(1, nome);
                Response.Write(nome.Value);
            }
            catch (EntitySqlException ex)
            {
                Response.Write("Erro EntitySqlException");
            }
            catch (EntityCommandExecutionException ex)
            {
                Response.Write("Erro EntityCommandExecutionException");
            }
        }

    }
}