帮我解决这个错误 [英] help me to resolve this error

查看:63
本文介绍了帮我解决这个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码。和错误的是一个字段,但像方法一样使用错误来自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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆