ab2ae
asked on
Getting BLOB data field from database into a standard textbox
I have two types of BLOB in my database, image and text. I can save and retrieve images fine. I can store text in my database but have no idea how to get it into a textbox.
I can get a BLOB object from my MS Access 2000 database into a picturebox, how do i get it into a textbox? I have this code for the picturebox
'if its an image then do this
Dim ByteArray() As Byte
'assign BLOB from db to bytearray
ByteArray = DirectCast((myDataTable.Ro ws(0)(0)), Byte())
'assign bytearray to memorystream
Dim memstrm As New MemoryStream(ByteArray)
'assign memorystream to picturebox
PictureBox1.Image = Image.FromStream(memstrm)
'if its text then do this
'textbox1.Text = ????
any help much appreciated
I can get a BLOB object from my MS Access 2000 database into a picturebox, how do i get it into a textbox? I have this code for the picturebox
'if its an image then do this
Dim ByteArray() As Byte
'assign BLOB from db to bytearray
ByteArray = DirectCast((myDataTable.Ro
'assign bytearray to memorystream
Dim memstrm As New MemoryStream(ByteArray)
'assign memorystream to picturebox
PictureBox1.Image = Image.FromStream(memstrm)
'if its text then do this
'textbox1.Text = ????
any help much appreciated
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER