private void loadGrid() { Prova1Entities context = new Prova1Entities(); List <figurinha> lstIstrumento = context.figurinha.ToList <figurinha>(); GridFigurinha.DataSource = lstIstrumento; GridFigurinha.DataBind(); }
protected void btn_salvar(object sender, EventArgs e) { figurinha fi = new figurinha() { descricao = txtDescricao.Text, ano = Convert.ToInt32(txtAno.Text) }; Prova1Entities context = new Prova1Entities(); context.figurinha.Add(fi); context.SaveChanges(); loadGrid(); }