protected void Page_Load(object sender, EventArgs e) { try { bdWebEntities ef = new bdWebEntities(); var paises = (from p in ef.pais select p).ToList(); } }
protected void bRegistrar_Click(Object ob, EventArgs ev) { bdWebEntities ef = new bdWebEntities(); try { pais p = new pais(); p.pais1 = tbPais.Text; ef.pais.Add(p); ef.SaveChanges(); Response.Redirect("wfPais.aspx"); } catch (Exception ex) { lMsg.Text = "Error " + ex.Message; } }