Can I update my datagrid DataContext without saving  changes unless I really want to do it.?

Yampolka
Yampolka used Ask the Experts™
on
I have a problem when I add an entity object with
ObjectContext.AddObject method because I can't
retrieve that object with LINQ querying my
ObjectContext.Person entities. I know that this
new added object is stored somewhere, because it
is used to update database after SaveChanges
method. That's bothers me because I want to
update my datagrid DataContext without saving
changes unless I really want to do it. It doesn't
help if I add the same object to DataContext list myself directly.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Kamal KhaleefaInformation Security Specialist

Commented:
try to use a session or temporary object to store all ur data to it

then when u clck on some button save ur dataa to the data base
YampolkaValeriya Yampolska

Author

Commented:
Supposing  entity Customers  bind to the grid  and user added one  Customer   to the  to the  Customers
Can I do something to let user see new Customer in Customers entity and undo the operation without hitting the database?.
Information Security Specialist
Commented:
yes

you can do all your work on the temporary object before storing on the database

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial