B i r d
10/8/2008 12:35:00 PM
please note that I also posted in the csharp forum, but this indeed
should happen on any .net flavour. I will update both postings as
feedback comes in. Thank you in advance for your help!
For whatever reason, I cannot get the simplest database app to work.
This is my environment:
SQL 2008 Standard
SQL Embedded 3.? (Not express)
Sample database table:
table people
peopleID (int, primary key, identity etc)
fullname nvarchar
whatever nvarchar
I then create a new form, drop a bindingnavigator on the form, link
it
to the database which generates the dataset, datasource and
dataadaptors.
I then go into the database and add 2 rows manually for content.
I then add two textboxes to the form and via the databinding connect
it to the datasource.
I then add an event for bindingsource item changed (I believe that is
the event), and add an event for onformclose. in both of these
methods
I call endEdit to the datasource, and pass the dataset to the
dataadaptor.Update.
When I am running, I can change either of the two rows, and they are
commited to the database, however if I add an extra row, I get a
Concurrency violation: the UpdateCommand affected 0 of the expected 1
I have done nothing fancy, all of the updates work, however I cannot
add new rows and am totally stumped. Googling the concurrency error
only gives info regarding having a database name in the update
statement, which does not exist (and updates work just fine).
Any advice would be appreciated, I am stumped.
Thanks!
Derek