Can't seem to get a linq bound datagrid to be savable vb.net -
It seems that it should be simple, but I've fought with it for 2 days.
I have a datagrid, filling it with a linux query, editing it to the user, saving it via sub-messages.
This works:
Dim ReportData 2 = T. Db.Inventory_Items T Select but this clearly Gives all the columns ... So .. try this:
Slow reportdata2 = In TDB select Inventory_ITs T.Description, T. The client looks fine but I will not let the edit - seems to be read only, okay ... by creating an ordinary class, avoid the anonymous type:
Dim Report Data 2 = DB.Inventory_ITs {new_name}. {.emem_Desc = t.Description} Now I can edit it, but when I Submeptanges, it does not throw an error, but it does not save the database.
What is the world that I am missing?
Any help will be awesome!
The problem is that you are not editing any object from your data reference , Some of them are getting data and putting it into new items, then modifying those new items, modifying those new objects does not affect the original objects, so in the database To save, no one in those original objects Discharge is not.
If you are not really going to modify the original objects in the first place, you will need to map changes to those original objects from your new object and then save those changes. This means that before saving, get a list from the context of your data, loop through it and update each one with the respective testventory object, either that the data is in context Items are flagged as being added or modified instead of new ones.
Comments
Post a Comment