How Can I read the Binary data from Database
am 24.12.2007 20:38:00 von Husam
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?
RE: How Can I read the Binary data from Database
am 25.12.2007 15:43:00 von pbromberg
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?