update db

  • Thread starter Thread starter Hrvoje Voda
  • Start date Start date
H

Hrvoje Voda

I'm adding a field with no value into table. In table I'm allowing null
value.
Then, I'm doing an update and I put a value into that field, but I get an
error:

System.Data Concurency Violation : the Update Command affected 0 records.

Why?

Then, when I close a program and call it again and I try to put a value into
that empty field I don't get an error.

Where is a problem?

Hrcko
 
Hrvoje,

Can you show the code you are using? A concurrency violation indicates
that there has been a change in the table's values from the time that you
selected the values from the table.

Do you have a timestamp on the table? If you don't, the data adapter
will check for concurrency by checking the value of each individual field,
which can be problematic.

Hope this helps.
 
What is timestamp?
Should I put on the table?
How?




Nicholas Paldino said:
Hrvoje,

Can you show the code you are using? A concurrency violation indicates
that there has been a change in the table's values from the time that you
selected the values from the table.

Do you have a timestamp on the table? If you don't, the data adapter
will check for concurrency by checking the value of each individual field,
which can be problematic.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hrvoje Voda said:
I'm adding a field with no value into table. In table I'm allowing null
value.
Then, I'm doing an update and I put a value into that field, but I get an
error:

System.Data Concurency Violation : the Update Command affected 0 records.

Why?

Then, when I close a program and call it again and I try to put a value
into that empty field I don't get an error.

Where is a problem?

Hrcko
 
Back
Top