473,327 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

BLOB Problems

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.

/// <summary>

/// The ImageID variable holds the ImageID passed from ViewImages </summary>

int ImageId = System.Convert.ToInt32(Request.QueryString["ImageId"]);

/// <summary>

/// imageContent will be used to hold the record returned from the database.

/// This line calls the GetImages function. </summary>

SqlDataReader imageContent = GetImages(ImageId);

/// <summary>

/// The Read method is used to load the record into memory </summary>

imageContent.Read();

/// <summary>

/// The ImageType is retrieved from the database and sent to the browser as
the

/// ContentType. This tells the browser how to display the image. </summary>

Response.ContentType = imageContent["ImageType"].ToString();

/// <summary>

/// The OutputStream.Write is used to write a byte array of the image,
starting at

/// the first byte and proceeding through the entire file. </summary>

Response.OutputStream.Write((byte[])imageContent["ImageFile"], 0,
System.Convert.ToInt32(imageContent["ImageSize"]));

Response.Write ("help");

/// <summary>

/// Call the End method to indicate to the browser that the entire image has
been sent. </summary>

Response.End();

I have taken this code from

http://msdn.microsoft.com/vcsharp/do...s/default.aspx

Read and Write Images to a SQL Server Database with C#

thanx


Jul 21 '05 #1
0 1129

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

Similar topics

1
by: Big Red | last post by:
Hi all I am reasonably new at php. I have a database table with three fields, id, caption and data. I have used the id and caption to create a dynamic menu. it just throws it into a loop with...
2
by: Ole Hansen | last post by:
Hi, Is it possible to insert BLOB data without doing a select first? I have data available and want to insert a row with BLOB data. Should I use the callback function with OCILobWrite() or is...
0
by: REM | last post by:
I have some problems. It's dilemma between BLOB, BFILE and takes care of file on file system. What it's advantage?? I import some PDF document in BLOB filed in my database. It's about 1000...
7
by: sime | last post by:
Hi, I have a blob field in a mysql database table. I want to copy a blob from one record to another. I am having trouble transferring the data via a php variable. Maybe I need to addslashes or...
11
by: CSN | last post by:
Is it possible to iterate over an array in plpgsql? Something like: function insert_stuff (rel_ids int) .... foreach rel_ids as id insert into table (rel_id, val) values (id, 5);
1
by: Roberto Castro | last post by:
I have some problems with the way I am showing the BLOB fields in the Image web controls. It does work on my localhost though sometimes I need to hit Refresh for the images to load properly....
1
by: Selen | last post by:
which one is good blob or store documents on the server???? Thanks
11
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 =...
55
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...
16
by: wizard | last post by:
Here is a piece of code below for writing and reading blobs in SQLITE database. I ' ve a problem to read from blob struct called 'Points' Any help would be appreciated Reagards Greg ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.