c# - ContactSchema.Birthday for Microsoft.Exchange.WebServices is trhowing exception -
i exporting contacts office365 using microsoft.exchange.webservices. have contactschema.department property working same code throwing exception contactschema.birthday field.
the exception occurs in line:
microsoft.exchange.webservices.data.contact.birthday
the exception get_birthday() threw exception
i have following code contact:
contact c = contact.bind(service, items[i].id, new propertyset(contactschema.body, contactschema.birthday));
any idea of how have handle birthday field?
that error means property wasn't set on contact. birthday optional property means if hasn't been set no value returned. because datetime value can't null, while hasvalue should work test of plumbing in ews managed api doesn't appear work should. recommend testing property first using trygetproperty work without throwing exception eg.
object birthdayvalue = null; if (c.trygetproperty(contactschema.birthday,out birthdayvalue)) { console.writeline(birthdayvalue); }
cheers glen
Comments
Post a Comment