帮我解决这个错误 [英] help me to resolve this error
问题描述
这是我的代码。和错误的是一个字段,但像方法一样使用错误来自AttachmentCollection。
if(AttachmentCollections.ContainsKey(activityid)){
Hashtable Attachments = default(Hashtable);
Attachments = AttachmentCollections(activityid);
DictionaryEntry this_entry = default(DictionaryEntry);
Hashtable this_attachment = default(Hashtable);
foreach(this_entry在附件中){
this_attachment = this_entry.Value;
delete_attachment(Convert.ToInt32(this_attachment [AttachmentID]));
}
}
错误出现在代码的下一行:
附件= AttachmentCollections(activityid);
你必须纠正它:
附件= AttachmentCollections [activityid];
here is my code. and error of "is a field but used like method" error is comingin the AttachmentCollection.
if (AttachmentCollections.ContainsKey(activityid)) {
Hashtable Attachments = default(Hashtable);
Attachments = AttachmentCollections(activityid);
DictionaryEntry this_entry = default(DictionaryEntry);
Hashtable this_attachment = default(Hashtable);
foreach ( this_entry in Attachments) {
this_attachment = this_entry.Value;
delete_attachment(Convert.ToInt32(this_attachment["AttachmentID"]));
}
}
The error is in the next line of your code:
Attachments = AttachmentCollections(activityid);
you have to correct it like:
Attachments = AttachmentCollections[activityid];
这篇关于帮我解决这个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!