Storing byte[] into access table

Posted on 2007-04-07
Last Modified: 2013-12-17

I have a value of type:


I want to save that value into an access file. Then i need to retrieve it later in the same format of bytes. Since i am very new in .Net I couldn't do it myself. What could be the correct field type to hold such a value and how to assign it and retrieve it. Sample code is highly appreciated.

Could you please help?

Question by:HamidHossain
LVL 15

Expert Comment

ID: 18870903

Author Comment

ID: 18871330

Thanks for contributing. I checked that page out. It is showing a sql server example, while i need ms access. sample code is written by VB.Net, while i need C#

Couldn't get advantage of that page.

LVL 22

Accepted Solution

p_davis earned 50 total points
ID: 18877149
all of the .net languages are very similar per the link that deepaknet posted a conversion of that might look something like
using System.IO;
using System.Data;
using System.Data.Odbc;
public Int32 SaveDocument(Stream docData, string docFileName)
            Byte Filedata = new Byte(docData.Length-1);
            docData.Read(Filedata, 0, docData.Length);

you can use the odbc to connect to an access db.

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question