private void button2_Click(object sender, EventArgs e) { PrincipalFP db = new PrincipalFP(); DBclass.Categoria ca = new DBclass.Categoria(); ca.Nombre = textBox2.Text; db.Categoria.Add(ca); db.SaveChanges(); MessageBox.Show("Registro exito."); textBox1.Clear(); textBox2.Clear(); }
private void button2_Click(object sender, EventArgs e) { PrincipalFP db = new PrincipalFP(); DBclass.Categoria ca = new DBclass.Categoria(); ca.Nombre = textBox2.Text; db.Categoria.Add(ca); db.SaveChanges(); MessageBox.Show("Registro exito."); textBox1.Clear(); textBox2.Clear(); }