Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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"]));
}
}
Posted

1 solution

The error is in the next line of your code:
C#
Attachments = AttachmentCollections(activityid);

you have to correct it like:
C#
Attachments = AttachmentCollections[activityid];
 
Share this answer
 
Comments
Member 11758222 12-Jun-15 1:13am    
still it is giving an error
Raul Iloc 12-Jun-15 1:17am    
You should give details about the errors (error message, line of code) in order to can help you.
Member 11758222 12-Jun-15 5:01am    
cannot explictely convert object to system.collections.hashtable. this isthe error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900