473,549 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BLOB Retrieve and Display problems

I have extensively searched for a solution. Below is my code that is
contained in an aspx. When my browser hits this aspx, I just get the
standard broken image picture. I know the data is the database is
correct because I have seen another employee retrieve it using Crystal
Reports. Can someone please tell me what I am doing wrong and offer a
suggestion to make this work? (This code does not generate errors, I
just can't the image to display.)
Adam
-----

Dim objSqlConnectio n As New SqlConnection
objSqlConnectio n.ConnectionStr ing =
Application("Co nnectionString" )

Dim id As Integer
id = 1956

Dim SQLcn As New
SqlConnection(o bjSqlConnection .ConnectionStri ng)

SQLcn.Open()

Dim cmd As New SqlCommand("sel ect ImageFile from
xcultivarimages where cultivarid=" & id, SQLcn)

Dim objDS As New DataSet
Dim clsImages As New Plantware.clsCu ltivarImages(SQ Lcn, objDS)

Dim imageArray As DataRow() =
objDS.Tables(0) .Select("Cultiv arid = " & id)
Dim imageRow As DataRow

For Each imageRow In imageArray
Response.Expire s = 0
Response.Buffer = True
Response.Clear( )
Response.Conten tType = "image/jpeg"
Response.Binary Write(imageRow( "ImageFile" ))
Next
Nov 19 '05 #1
2 5221
you are trying to write out multiple images at the same time. The browser is
only expecting 1 image. Because you sent the data contained in multiple
images, it thinks that the 1 image is corrupt.

Try only writing out 1 image.

If you need to create a list of images, then you will need to create a html
page and link to each image separately.

hth,
Dave
www.aspNetEmail.com
"Adam" <ak************ **@yahoo.com> wrote in message
news:23******** *************** ***@posting.goo gle.com...
I have extensively searched for a solution. Below is my code that is
contained in an aspx. When my browser hits this aspx, I just get the
standard broken image picture. I know the data is the database is
correct because I have seen another employee retrieve it using Crystal
Reports. Can someone please tell me what I am doing wrong and offer a
suggestion to make this work? (This code does not generate errors, I
just can't the image to display.)
Adam
-----

Dim objSqlConnectio n As New SqlConnection
objSqlConnectio n.ConnectionStr ing =
Application("Co nnectionString" )

Dim id As Integer
id = 1956

Dim SQLcn As New
SqlConnection(o bjSqlConnection .ConnectionStri ng)

SQLcn.Open()

Dim cmd As New SqlCommand("sel ect ImageFile from
xcultivarimages where cultivarid=" & id, SQLcn)

Dim objDS As New DataSet
Dim clsImages As New Plantware.clsCu ltivarImages(SQ Lcn, objDS)

Dim imageArray As DataRow() =
objDS.Tables(0) .Select("Cultiv arid = " & id)
Dim imageRow As DataRow

For Each imageRow In imageArray
Response.Expire s = 0
Response.Buffer = True
Response.Clear( )
Response.Conten tType = "image/jpeg"
Response.Binary Write(imageRow( "ImageFile" ))
Next

Nov 19 '05 #2
Dave,
Thanks for your response. I tried displaying only one image, but it
still did not work. I then found out that the images were place into
the DB table using Access. From reading other posts, this leads me to
believe there is a header on the binary data. Is this true? If so,
how do I strip that header off?
Adam
"dave wanta" <no****@nospam. com> wrote in message news:<Oo******* *******@TK2MSFT NGP10.phx.gbl>. ..
you are trying to write out multiple images at the same time. The browser is
only expecting 1 image. Because you sent the data contained in multiple
images, it thinks that the 1 image is corrupt.

Try only writing out 1 image.

If you need to create a list of images, then you will need to create a html
page and link to each image separately.

hth,
Dave
www.aspNetEmail.com
"Adam" <ak************ **@yahoo.com> wrote in message
news:23******** *************** ***@posting.goo gle.com...
I have extensively searched for a solution. Below is my code that is
contained in an aspx. When my browser hits this aspx, I just get the
standard broken image picture. I know the data is the database is
correct because I have seen another employee retrieve it using Crystal
Reports. Can someone please tell me what I am doing wrong and offer a
suggestion to make this work? (This code does not generate errors, I
just can't the image to display.)
Adam
-----

Dim objSqlConnectio n As New SqlConnection
objSqlConnectio n.ConnectionStr ing =
Application("Co nnectionString" )

Dim id As Integer
id = 1956

Dim SQLcn As New
SqlConnection(o bjSqlConnection .ConnectionStri ng)

SQLcn.Open()

Dim cmd As New SqlCommand("sel ect ImageFile from
xcultivarimages where cultivarid=" & id, SQLcn)

Dim objDS As New DataSet
Dim clsImages As New Plantware.clsCu ltivarImages(SQ Lcn, objDS)

Dim imageArray As DataRow() =
objDS.Tables(0) .Select("Cultiv arid = " & id)
Dim imageRow As DataRow

For Each imageRow In imageArray
Response.Expire s = 0
Response.Buffer = True
Response.Clear( )
Response.Conten tType = "image/jpeg"
Response.Binary Write(imageRow( "ImageFile" ))
Next

Nov 19 '05 #3

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

Similar topics

5
2664
by: Bob Kaku | last post by:
I've created a MySQL database to store a large amount of text. Since the text data type in MySQL is limited to 255 characters, I added a BLOB column. I created an PHP input screen to enter the large text. It seems to work. But, I cannot verify the entry, because the standard select SQL does not display the contents. I want to retrieve...
0
3410
by: Corrine | last post by:
I am trying to pass a temporary BLOB that I've created in Java, to a PLSQL function that modifies it, and then to retrieve this modified value back to Java, all using JDBC. I can't figure out how to get the modified BLOB object back to Java after the PLSQL block has finished executing. I do: BLOB bl =...
0
1147
by: ichor | last post by:
hi i have a blob in my sql server database, that i would like to display on my web page.. i have 2 problems with this. 1). i am able to display it but i cant add any text in the page. 2) also i would like to position the text and the image. this is the function used to write out the img to the browser.
4
8943
by: alan_sec | last post by:
Hi. I'm trying to retrieve blob obect from DB2 database using COM.ibm.db2.jdbc.net.DB2Driver driver. When i' m trying to get Blob from result set (resultSet.getBlob(1)) i got this exception: java.lang.AbstractMethodError: COM.ibm.db2.jdbc.net.DB2ResultSet.getBlob(I)Ljava/sql/Blob; What is the problem? How can i retrieve blob using this...
0
2329
by: Wescotte | last post by:
I'm abit confused on how to work with binary data with an ODBC connection (My database is DB2 btw) Say I have a table like CREATE TABLE EJWLIB.BLOBTEST ( ID NUMERIC(5) NOT NULL, FILENAME VARCHAR(128) NOT NULL, BINARY BLOB(2M) ) Now I (I assume this is the correct method) insert data in the
11
3909
by: Peter Afonin | last post by:
Hello, I have Word documents stored in the Oracle database in the BLOB field that I need to retrieve. I've found the way of doing it: While dr.Read sName = dr("TE_PM_ATTACH_NAME") bLob = dr.GetOracleLob(1)
2
6491
by: Vinciz | last post by:
hi guys... im new in java and i would love to learn some of these... basically i got a sample code to retrieve the blob from the mysql. however, i dont really know what to do with these retrieved byte/binary data as i got no idea on how to save them in our pc. For this situation, what i need to do is give the byte/binary data an extension...
9
7965
by: matt | last post by:
hello, im doing my first ASP.NET app that inserts & retrieves files from Oracle (no need for a discussion on *that*!). i learned first-hand of the somewhat awkward technique for inserting binary data into an Oracle BLOB column via ADO.NET. since my files are larger than 33k, it seemed had to use this technique: ...
55
24703
ADezii
by: ADezii | last post by:
Of all the questions asked here at TheScripts, the one which appears with the most frequency relates to the storing of Graphic Images within Access. There are basically three techniques available to manipulate Image Files in Access and they are: Store the Image in an OLE Object Field and display it in a Bound Object Frame. The Image can...
0
7743
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7986
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7504
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5391
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3518
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3499
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
786
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.