Problems updating from a c # .aspx form?

0

Good day, I have a capture form in c # .aspx, where I generate a data capture of a personal, I use entityframework, the design of the table is as follows:

The problem is that when the same form is opened by 2 or more users and the update function is used, the data is updated for those who first click on the save button when editing the data, which causes the another user that their data is combined with those of the other user who has opened the same form Any idea to request the problem?

The update I do it in the following way:

tcpersona persona= ctx.tcpersona.Where(p => p.idpersona== (int)Session["idpersona"]).FirstOrDefault();

    if(persona!=null){
    persona.nombrepersona= txtnombre.Text;
    persona.domicilio = txtdomicilio.Text;
    persona.tel = txttel.Text;
    }
ctx.SaveChanges();
asked by Begginer 25.05.2018 в 18:07
source

0 answers