473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

concurrency violation:the UpdateCommand affect 0 of the expected 1 records

this is my code for update, please why the error

public void Modificar_HuespedV(int no_orden, int nno_orden, string nombre, string apellidos, double ci, int no_habitacion, string fecha_entrada,
string fecha_salida, int cant_acompanantes, int dias_hospedado, int cuota_persona, int total_cobrar,
int no_cobrado, string fecha_cobrado)
{
int pos = 0;
for (int i = 0; i < tabla3.Tables["Vacacional"].Rows.Count; i++)
{
if (tabla3.Tables["Vacacional"].Rows[i][0].ToString() == no_orden.ToString())
{
pos = i;
break;
}
}
DataRow row = tabla3.Tables["Vacacional"].Rows[pos];
row.BeginEdit();
row["No"] = nno_orden;
row["Nombre"] = nombre;
row["Apellidos"] = apellidos;
row["No_Identidad"] = ci;
row["No_Cuarto"] = no_habitacion;
row["Fecha_Entrada"] = fecha_entrada;
row["Fecha_Salida"] = fecha_salida;
row["Acompanantes"] = cant_acompanantes;
row["Dias_Hospedado"] = dias_hospedado;
row["Cuota_Persona"] = cuota_persona;
row["Total_Cobro"] = total_cobrar;
row["No_Recibo"] = no_cobrado;
row["Fecha_Recibo"] = fecha_cobrado;
row.EndEdit();
OleDbCommandBuilder validar = new OleDbCommandBuilder(canal3);
canal3.Update(tabla3,"Vacacional");

Cargar_HuespedesV();
}
Nov 23 '09 #1
0 1725

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: nick | last post by:
I'm having trouble updating from a datagrid. It's says "Concurrency violation: the UpdateCommand affected 0 records", though I can't see how it's related to "concurrency". I can insert and delete...
0
by: Dzemo | last post by:
i use this code to get data into dataset cmd.CommandType = CommandType.Text cmdUpdate.CommandType = CommandType.Text cmdUpdate.CommandText = "Update BigOne Set Rezultat=? where ID=?" ...
1
by: Geraldine Hobley | last post by:
Hello, I have a problem whereby I have a datagrid that is bound to a dataTable. However occassionally when I edit the datagrid I get the following message. Concurrency Violation the update...
1
by: Bob Vlad via DotNetMonster.com | last post by:
What I am trying to do is wipe information from a number of tables after submission to a SQL server database. Of the 6 tables I am trying to wipe I have had no issues with 5 of them. Multiple...
5
by: Vayse | last post by:
In my save code, most of items save fine. But sometimes I get a concurrency violation message. "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records." It happens on the...
0
by: Dzemal Tipura | last post by:
I populate dataset using this code Me.KorisniciTableAdapter.FillByID(Me.DsKorisnici.Korisnici, IDKorisnika) columns from this dataset are bounded to controls on the form and I want to save...
1
by: Miriam | last post by:
Hello, I got the error "Concurrency violation: the UpdateCommand affected 0 records" while updating some records in the Windows Application. I am using VB.net in VS 2003 and the backend is...
2
by: dermot | last post by:
Hi, I have a vb.net application accessing a SQL Server 2005 Database. It applys changes to the database using stored procedures. Updates and Inserts are working fine. Parent Table =...
0
by: sherifffruitfly | last post by:
Hi, I'm deleting a bunch of records from my DB, and they actually DO get deleted (as I verify by looking afterwards). But then I get the exception in the subject line. Isn't it weird that all of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.