Linq2Sql not updating NVarchar(Max) field?
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.
Has your entity got a primary key?
精彩评论