Solved

How to upload image in msacess

Posted on 2008-11-01
1
274 Views
Last Modified: 2012-05-05
I want to upload and reterive a image file in ms acess.I am making a desktop application in vb.net and in backend in ms acess..
0
Comment
Question by:raboy007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
techExtreme earned 500 total points
ID: 22857894
Hello,
Follow this article, there it is explained in detail with source code for how you can pass image in byte stream format to upload to ms access database.
Article: http://programming.top54u.com/post/VB-Code-to-Upload-Image-to-MS-Access-Database-in-ASP-Net.aspx
Still I'm pasting code here for your reference

Dim imageSize As Int64 
Dim imageType As String 
 
Dim imageStream As Stream 
 
' Gets the Size of the Image 
 
imageSize = fileImgUpload.PostedFile.ContentLength 
  
 
' Gets the Image Type 
 
imageType = fileImgUpload.PostedFile.ContentType 
  
 
' Reads the Image stream 
 
imageStream = fileImgUpload.PostedFile.InputStream 
  
 
Store the InputStream using the above ASP file upload control function into the Stream type variable.  
  
 
Dim imageContent(imageSize) As Byte 
 
Dim intStatus As Integer 
 
intStatus = imageStream.Read(imageContent, 0, imageSize) 
  
 
Create the Byte array as in the above code to buffer the image binary stream byte by byte. 
 
To use the stream, you can import the following IO namespace: 
 
Imports System.IO

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

756 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