开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜