Thanks imsolost.
Your comment answers a question I asked in the db reporting area. If you can place the above comment there, and it works, i'll award you the points...
http://www.experts-exchang
Main Topics
Browse All TopicsI'm trying to write a setup form for a reporting services report. Part of the setup is to allow a user to choose a company logo to be displayed on the report.
What would be the best way to go about Uploading an image, displaying it for the user and then streaming the image data to be stored in the database?
I have achieved this in vb6 in the past. It was a simple case of displaying the image in an image box control and treating the image data like blob data.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks imsolost.
Your comment answers a question I asked in the db reporting area. If you can place the above comment there, and it works, i'll award you the points...
http://www.experts-exchang
The user can upload an image using a FileUpload web control. (Called FileUploadCntl in this example.)
Save the jpg image to the db:
Dim fs As FileStream
Dim ImgData() As Byte
fs = New FileStream(FileUploadCntl.
'read the file
ReDim ImgData(CInt(fs.Length))
fs.Read(ImgData, 0, CInt(fs.Length))
fs.Close()
Then use a SQL statement that will store the contents of ImgData into an image field on the db.
Readsthe image from the db and save it as a file that can be displayed:
Dim fs As FileStream
Dim sImgPath As String
Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
Dim ImgData() As Byte
Dim K As Long
'Get image
ImgData = CType(ds.Tables(0).Rows(0)
K = UBound(ImgData)
'Get the image directory
sImgPath = "C:\The path of where the image should be saved"
'Save the image
fs = New FileStream(sImgPath, FileMode.OpenOrCreate, FileAccess.Write)
fs.Write(ImgData, 0, CInt(K))
fs.Close()
I don't believe it is a different question. The original question asked how I can get an image from an asp .net page to the database. The technology itself implies there is a separate client machine and web server.
The solution provided only works if your client is run on the web server which would be a highly unusual way to implement a solution using ASP .Net.
I am really sorry, I misunderstood your question.
Try this:
http://aspalliance.com/art
If you are using ASP.NET 2.0:
http://www.dotnetjohn.com/
I meant to post this link, although the previous one may still help:
http://msdn.microsoft.com/
Business Accounts
Answer for Membership
by: imsolostPosted on 2006-03-01 at 04:55:44ID: 16074403
reporting services has an image control that will read directly from the database. You wont need to code anything as long as the image is stored as an image data type (Binary). I will post the code to upload the image to the database in a few hours.