2012-12-24 120 views
0

我正在嘗試添加更多所需的與會者。但我跑錯了,代碼是-2146233087。更新約會時出錯

activityparty activityParty = new activityparty();   
activityParty.partyid = new Lookup();    
activityParty.partyid.Value = contact.contactid.Value;  
appointment.requiredattendees = new activityparty[] { activityParty }; 
service.Update(appointment); 

回答

1

嗨atlast我發現這個問題,我錯過了實體的類型和劉以達的問題。但它只是將錯誤作爲異常拋出,而沒有告訴它,添加類型之後它已被修復。

activityparty activityParty = new activityparty();   
activityParty.partyid = new Lookup();    
activityParty.partyid.Value = contact.contactid.Value;  
**activityParty.partyid.type = "contact";** 
appointment.requiredattendees = new activityparty[] { activityParty }; 
service.Update(appointment);