Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8178535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:47:25+00:00 2026-06-06T23:47:25+00:00

I am trying to attach a binary data retrieved from SQL server to an

  • 0

I am trying to attach a binary data retrieved from SQL server to an email as attachment using VB.net in the office addin.

I am able to add attachment if I specified the file path and file name, but not with binary data, below is my sample code:

Dim ms as System.IO.MemoryStream
'binaryData is retrieved from SQL server
'binaryData is a docx file stored in SQL server
ms = New System.IO.MemoryStream(binaryData)  

Dim att as New System.Net.Mail.Attachment(ms, System.Net.Mime.MediaTypeNames.Text.Plain)

mailItem.Attachments.Add(ms)  'mailItemm is Microsoft.Office.Interio.Outlook.MailItem

I’m getting error

COMException was unhandled by user code
Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))

I am using:

Visual Studio 2010
.Net 4.0
Microsoft Outlook 2010

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:47:26+00:00Added an answer on June 6, 2026 at 11:47 pm

    At the end, I saved the binary data to a file in users temp folder, then attached the file, then delete the file from the temp folder, it is simpler that way.
    Thanks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to attach my mdf files to SQL server (using windows XP)
I'm trying to attach a PDF attachment to an email being sent with System.Net.Mail.
I'm trying to attach a file to an outgoing email but the attachment size
I am trying to attach a file from from my website using pulling from
I am trying to attach a database in SQL Server 2008 and I have
I'm trying to attach my database on a server that is running SQL2005 and
I have loaded Web Site from HDD. Now trying attach it to process WebDev.WebServer.EXE.
I'm trying to attach multiple Behaviors to an UIElement (which, just judging from the
im trying to test and then implement LINQ 2 SQL as my Data Access
I am trying to attach a database in sql 2005 but I get an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.