Japneet Singh
Japneet Singh

Reputation: 261

Dynamically update table rows in entity framework

Can anyone tell how to update table rows dynamically in entity framework? I am new in entity framework. Thanks in advance.

Upvotes: 2

Views: 312

Answers (1)

Levi Botelho
Levi Botelho

Reputation: 25214

This is a pretty general question, but what you need to do is basically this:

  1. Access your data context.
  2. Get a given object (/record) from your context (/database).
  3. Change the object.
  4. Call SaveChanges() on the data context.

If you are learning EF a site that helped me a lot when I was learning it is http://msdn.microsoft.com/en-us/library/gg696194(VS.103).aspx. It contains lots of information in problem/solution format. You can also look at this book:

http://www.amazon.com/Programming-Entity-Framework-Building-Centric/dp/0596807260/ref=sr_1_1?ie=UTF8&qid=1355991856&sr=8-1&keywords=entity+framework

or this book:

http://www.amazon.com/Programming-Entity-Framework-Code-First/dp/1449312942/ref=sr_1_4?ie=UTF8&qid=1355991858&sr=8-4&keywords=entity+framework

which are both quite useful depending on whether you wish to use the designer or Code First.

Upvotes: 1

Related Questions