Click here to Skip to main content
15,896,320 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new on entity frame work. I am trying to developing my first wpf application using entity frame work. i don't know how can i insert,delete and update data using entity frame work in wpf application. I am using ado.net data model for binding the controls.
Posted

If you're using EF, you just add, change or delete objects from the collections tied to your database wrapper instance, then call SaveChanges to save all changes you've made.
 
Share this answer
 
Comments
entiresol 4-Aug-12 3:17am    
@Christian Graus can you give me some example that how can i add, change or delete objects from the collections tied to your database wrapper instance
Christian Graus 4-Aug-12 3:57am    
You have a class that has a list of DB objects, you just search for the object you want to remove then call the Delete or Remove ( I forget ) method of that collection. You can actually create a new object that has the right id and pass that in to the delete method. You create a new object, and call add. You can search for an object and change it, then it's changed, you don't need to do any more.

Overall, i suggest buying a book or reading some articles.
This article explains how to perform basic CRUD operations using entity framework. It contains everything you need to get your application up and running.

An Introduction to Entity Framework for Absolute Beginners[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900