I have a simple winforms application that I connect to my database using linq-to-sql.
I created the classes directly from the database, and I have a DataAccess class that wraps my datacontext and can give me everything I need.
I have a view that uses a data source object to populate a DataGridView and a set of related text fields, etc. for my entity (lets call it EmployeeView)
The view loads all existing rows, and as I click on the grid, the fields are updated accordingly.
If I changed the fields, the changes will be saved using the record changes, but I'm not sure how to save the changes at my data access level. How can I determine which records are dirty and need to be saved? How can I save them? What is the best way to add new entries? Delete entries?
I can find many resources on the Internet, but not one of the examples that I need. Can someone help me with some basic templates or point me to a good place?
source
share