tags:

views:

767

answers:

3
+1  Q: 

Linq update record

how update a record on specific id in linq + asp.net c#

+2  A: 

See this post

Sander Rijken
A: 

Care to post some sample code you've taken a stab at.

If it's linq2sql, then it should be a simple matter of Retrieving your object using your linq datacontext using a Where<T>() clause , updating the object property and then calling the DataContext.SubmitChanges()

Eoin Campbell
+1  A: 

You can do it like this...

var record = 
(
   from x in db.TableName
   where x.Id == 12345
   select x
)
.Single()

x.DateUpdated = DateTime.Now;

db.SubmitChanges();

Hope it helps :)

Chalkey