Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Retrieve image fields from contact and save to sql db

(0) ShareShare
ReportReport
Posted on by 65

Hi

I am trying to retrieve contact picture(byte[]) and save to azure sql db.

I have tried Data Export Service but these type of entity image fields are not supported. So, trying to write console app.

Please see my code below

pastedimage1668001924409v1.png


The code is working but entityimage is inserted as 0x53797374656D2E427974655B5D for all contacts.

Why is it? Where did I do mistake?

Is this the correct way?

Regards

  • rajkm Profile Picture
    rajkm 65 on at
    RE: Retrieve image fields from contact and save to sql db

    Thanks, it worked

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,087 Super User 2024 Season 1 on at
    RE: Retrieve image fields from contact and save to sql db

    I didn't test but the code should be

    byte[] byteData = a["entityimage"] as byte[];

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans