Concurrency violation: the UpdateCommand affected 0 of the expected 1 records

bd access 2003 , vs 2005 , csharp Havanna, Cuba
  • 10 years ago

    hello, please help me, i have an aplication that to try updaten the first data

    tell me:Syntax error in UPDATE statement, and when i try change any other data

    tell me: Concurrency violation: the UpdateCommand affected 0 of the expected 1

    records this is the code

    public void ModificarHuespedV(int noorden, int nno_orden, string nombre, string

    apellidos, double ci, int nohabitacion, string fechaentrada, string fechasalida, int cantacompanantes, int dias_hospedado, int

    cuotapersona, int totalcobrar, int nocobrado, string fechacobrado) {

            int pos = 0;
            for (int i = 0; i < tabla3.Tables["Vacacional"].Rows.Count; i++)
            {
                if (tabla3.Tables["Vacacional"].Rows[i][0].ToString() ==
    

    noorden.ToString()) { pos = i; break; } } DataRow row = tabla3.Tables["Vacacional"].Rows[pos]; row.BeginEdit(); row["No"] = nnoorden; row["Nombre"] = nombre; row["Apellidos"] = apellidos; row["NoIdentidad"] = ci; row["NoCuarto"] = nohabitacion; row["FechaEntrada"] = fechaentrada; row["FechaSalida"] = fechasalida; row["Acompanantes"] = cantacompanantes; row["DiasHospedado"] = diashospedado; row["CuotaPersona"] = cuotapersona; row["TotalCobro"] = totalcobrar; row["NoRecibo"] = nocobrado; row["FechaRecibo"] = fechacobrado; row.EndEdit(); OleDbCommandBuilder validar = new OleDbCommandBuilder(canal3); if (tabla3.HasChanges()) { canal3.Update(tabla3, "Vacacional"); tabla3.AcceptChanges(); }

            Cargar_HuespedesV();
        }
    

    pd:canal3=oledbdataadapter tabla3=dataset

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Better train people and risk they leave – than do nothing and risk they stay.” - Anonymous