views:

8

answers:

1

I have the folowing code to fetch a record and update one column which is of type NVarchar(Max) using Linq2Sql.

using (var context = new DataClasses1DataContext())
            {
                var entity = context.Entity.Where(d => d.ID == 12).Single();
                entity.EmailTemplate = "Test Template";
                context.SubmitChanges();
            }

What is wrong here? I am using Linq2Sql, .Net 4 and Sql Server 2005.

+1  A: 

Has your entity got a primary key?

Amitabh
omg im so silly. that was the problem thanks
Bobby
so... please, mark the answer as accepted.
Jonathan