473,396 Members | 1,756 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,396 software developers and data experts.

BLOB in asp

Nau
How can I display BLOB(Oracle) data in asp page

Jan 19 '06 #1
4 2140
Since a BLOB is simply binary data (a stream of 1s and 0s), you cannot
display int in an ASP.Net or ASP page unless you know what the data is.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Nau" <na***********@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
How can I display BLOB(Oracle) data in asp page

Jan 19 '06 #2
Nau
I forgot to mention that i have a 'gif ' image stored in the
database(oracle 9i) in a BLOB column , i need to display this data in a
asp page

Jan 23 '06 #3
1. Create an ASP.Net page that will serve as an image. Use the
Request.QueryString to determine the file name. You can then add an image
tag to any page that points to its URL as it would point to an image file.
Example:

<img src="image.aspx?filename=foo.gif">

Read the data from the BLOB into a byte array. Set the Response.ContentType
of the page to "image/gif" Use Response.BiaryWrite to write the byte array
to the output stream.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"Nau" <na***********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I forgot to mention that i have a 'gif ' image stored in the
database(oracle 9i) in a BLOB column , i need to display this data in a
asp page

Jan 23 '06 #4
Ya better write bit by bit

string _filePath = "..."

Response.Clear();
Response.ContentType = "image/gif";
Response.Buffer = false;
FileStream _fileStream = null;
byte[] _buffer = new byte[1024];
long _byteCount;
try
{
_fileStream = File.OpenRead(_filePath);
while ((_byteCount =
_fileStream.Read(_buffer, 0, _buffer.Length)) > 0)
{
if(Response.IsClientConnected)
{
Response.OutputStream.Write(
_buffer, 0, _buffer.Length);
Response.Flush();
}
else
{
return;
}
}
}
catch(Exception _ex)
{
throw _ex;
}
finally
{
_fileStream.Close();
}
--Daniel
http://staff.newtelligence.com/danielf/


-----Original Message-----
From: Kevin Spencer [mailto:ke***@DIESPAMMERSDIEtakempis.com]
Posted At: Monday, January 23, 2006 1:01 PM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: BLOB in asp
Subject: Re: BLOB in asp

1. Create an ASP.Net page that will serve as an image. Use the
Request.QueryString to determine the file name. You can then add an
image
tag to any page that points to its URL as it would point to an image
file.
Example:

<img src="image.aspx?filename=foo.gif">

Read the data from the BLOB into a byte array. Set the
Response.ContentType
of the page to "image/gif" Use Response.BiaryWrite to write the byte
array
to the output stream.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"Nau" <na***********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I forgot to mention that i have a 'gif ' image stored in the
database(oracle 9i) in a BLOB column , i need to display this data in a asp page

Jan 23 '06 #5

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

Similar topics

2
by: Carolyn Longfoot | last post by:
Help! This is driving me crazy... I'm trying to read a BLOB from a db and display it in a browser, like so: $query="SELECT blob from table where blob_id=9"; $result=mysql_query($query);...
3
by: hamvil79 | last post by:
I'm implementig a java web application using MySQL as database. The main function of the application is basically to redistribuite documents. Those documents (PDF, DOC with an average size around...
15
by: Daniel Schuchardt | last post by:
Hi @ all, i'm sure there was a psql-function to transfere my Blob-Data to the server but I can't remember. I have a script like this : UPDATE xy SET z = lo_import('localpath_and_file'); ...
3
by: Carmine | last post by:
I have to add a date column to a db2/zos table with a blob column. Can I rename the blob table to old, create a new table with the date column, then insert/select the data from the old table? ...
0
by: Paul Kennedy | last post by:
I have a situation where I am utilizing code from MSDN to insert XLS files into a Microsoft Access Table in a column of Ole Object using VBA and DAO. That code also provides me with a method to...
1
by: Markusek Peter | last post by:
Hi, I'm using MySQLDriverCS. I've got no problem to store BLOB into database, but I can't get it back(save to file). Problem is with DataTable(returns string:( ) My code: -- DataTable dt = new...
0
by: Biztalk Migration | last post by:
I am new to using BLOB with oracle stored proc. I dont knw how to set the size of the buffer which seems to overflow no matter what i used to pass it. I am getting an error ...
2
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...
9
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...
4
by: skunapareddy | last post by:
I am needing to read a blob from database and pass it to another java program. I researched internet and found a program that reads a file on the client pc and gives bytes, but when I modified the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.