在XrmServiceContext中更新数据源 [英] Update Datasource in the XrmServiceContext
本文介绍了在XrmServiceContext中更新数据源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的朋友们
我写了一个动态crm程序。在这里,我在服务上下文中获取产品,并希望更新产品。我编写代码以更新下面的条目。
Dear friends
I wrote a dynamics crm program. Here, I fetch products in the service context and want to update products. I write my code to update entry below.
XrmServiceContext svcContext;
...
// select one and update
var query = from c in svcContext.productSet
where (c.ActivityId == id)
select c;
foreach(Product c in query)
{
c.LogicalName = "***"; // change logical name
// change some fields
svcContext.UpdateContact(c);
svcContext.SaveChanges();
}
但从未更新过。请帮帮我。
But never been updated. Please help me.
推荐答案
这篇关于在XrmServiceContext中更新数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文