473,397 Members | 2,084 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,397 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 1133

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 ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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
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...
0
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,...
0
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...

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.