2013-07-08 36 views
0

我想附加到字段,但是当我尝试以下时,现有数据(Update.Comments)会被followUpComments覆盖而不是附加到它。EF 4 - 追加到更新的字段

如何追加?

using (var context = new DBContext()){ 

     var Update = (from p in context.Prospects where p.id == recordIdToUpdate select p).Single(); 

     Update.Comments = Update.Comments + "\n\n" +followUpComments; 

     context.SaveChanges(); 

    } 
+0

您是否尝试过使用String.Concat代替+ –

+0

没有,我会尽力的。感谢 – Slinky

+0

James,使用String.Concat()修复了它。不知道为什么“+”运算符不起作用。发布作为解决方案,我会给你信贷和感谢 – Slinky

回答

0

使用String.Concat代替+运营商