Code Snippet
annotation anno = new annotation();
anno.objectid = CrmTypes.CreateLookup(entityName, entityID);
anno.mimetype = mimetype;
anno.filename = filename;
anno.filesize = filesize;
anno.documentbody = documentbody;
anno.objecttypecode =
new EntityNameReference(entityName);
anno.subject = "Subject of the attachment";
anno.isdocument = new CrmBoolean(true);
service.Create(anno);