FormView-Update with ObjectDataSource

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Daniel.Kania
Posts: 10
Joined: Wed 10 Mar 2010 13:20

FormView-Update with ObjectDataSource

Post by Daniel.Kania » Mon 25 Oct 2010 10:26

Hi,
what i making wrong:

My WebProject:



' ReadOnly="true">
'>









Now when i in EditMode and i change the field "Rvnr", then the following function calls:

pubic void SaveContext(decimal id, string rvnr) {
// first i get the object where id equal the parameter "id"
MyModel.MyObject mObj = getObject(id);

// Now i altered the field Rvnr
mObj.Rvnr = rvnr;

// and than i save the context
model.SaveChanges(true);
}

when i do this, i get this exception:

Speicheranweisung für Aktualisierung, Einfügen oder Löschen betraf eine unerwartete Anzahl an Zeilen (0). Möglicherweise wurden einige Entitäten seit dem Laden der Entitäten geändert oder gelöscht. Aktualisieren Sie die ObjectStateManager-Einträge.

What i do wrong or what i do not understood?

thx, Daniel

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 26 Oct 2010 15:42

Could you please make a small test project reproducing the issue and send it to support * devart * com (subject "EF+ObjectDataSource").
If possible, please add DB definition scripts of the objects you are using.
This will speed up our investigation.

Post Reply