473,511 Members | 15,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How Can I read the Binary data from Database

Hi EveryBody:

I have probelm that I hung with for three weeks, My problem is I want to
read Binary data from database. I will told you what I did :

first I declear an array byte and I cast the value in the database to byte
after that I use memory stream then I read the value by using method
FromMemoryStream that In Image class to finally but my pic In PictuerBox.

My code is lookslike the following:

Dim pic() as Byte=Ctype(myreader.getvalue(1),Byte())

myreader is the data reder that I used to read my data from database.

dim ms as new memorystream(pic)

with PictureBox1
..Image=Image.FromMemoryStrem(ms)
End with
But the probelm is I getthe length of pic() 0 thatmena there is no value.

I tried Alot of method and see alot Of Articals In reading blob or Binary
data from database but non were useful

So is thereany body can help me in this issue or direct me to any where to
do so?
Dec 24 '07 #1
1 1818
Dim pic as Byte() <-- byte ARRAY, not Byte <-- single byte.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Husam" wrote:
Hi EveryBody:

I have probelm that I hung with for three weeks, My problem is I want to
read Binary data from database. I will told you what I did :

first I declear an array byte and I cast the value in the database to byte
after that I use memory stream then I read the value by using method
FromMemoryStream that In Image class to finally but my pic In PictuerBox.

My code is lookslike the following:

Dim pic() as Byte=Ctype(myreader.getvalue(1),Byte())

myreader is the data reder that I used to read my data from database.

dim ms as new memorystream(pic)

with PictureBox1
.Image=Image.FromMemoryStrem(ms)
End with
But the probelm is I getthe length of pic() 0 thatmena there is no value.

I tried Alot of method and see alot Of Articals In reading blob or Binary
data from database but non were useful

So is thereany body can help me in this issue or direct me to any where to
do so?
Dec 25 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
21896
by: Thierry | last post by:
Hello, I do have a mysql database with a BLOB column. What is the proprest way to read this column ? Thx, Thierry
1
5215
by: guyv | last post by:
Hello! I wanna read binary data from database with ADODB.Stream object. So I wrote code.. --------- <% query = "SELECT * FROM Categories" adoDB.DefaultDatabase = "Northwind"
3
2464
by: Doug | last post by:
Working on converting an Access front-end/SQL Server back-end to a .NET front/SQL Server back-end. We are also redesiging the SQL Server database. We have many Word/Excel documents that have...
3
18953
by: nicolasg | last post by:
Hi, I'm trying to open a file (any file) in binary mode and save it inside a new text file. After that I want to read the source from the text file and save it back to the disk with its...
3
2925
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
I try to follow Steve's paper to build a database, and store a small text file into SQL Server database and retrieve it later. Only difference between my table and Steve's table is that I use NTEXT...
14
5735
by: Zoro | last post by:
My task is to read html files from disk and save them onto SQL Server database field. I have created an nvarchar(max) field to hold them. The problem is that some characters, particularly html...
4
2701
by: programmer27 | last post by:
i've been reading this binary files in this database still no luck. it's not an ordinary binary file. coz there's no file you can see, it's all in the database. i'll attach here the database...
4
7217
by: =?ISO-8859-1?Q?Hans_M=FCller?= | last post by:
Good morning folks, I cannot read a binary file into a mysql database. Everything I tried did not succeed. What I tried (found from various google lookups...) is this: con =...
1
6696
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I have probelm that I hung with for three weeks, My problem is I want to read Binary data from database. I will told you what I did : first I declear an array byte and I cast the...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.