473,809 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading BLOB

How to read a BLOB from oracle 8i using OleDb
Jul 21 '05 #1
1 1799
Here is my example using SqlClient... shouldn't be too different from what
you need. This example write the blob out to a file.

Public Sub Load()
Dim dr As Data.SqlClient. SqlDataReader
Dim ParamList(0) As SqlParameter
Dim index As Int32

Dim fs As FileStream
Dim bw As BinaryWriter

Dim intBufferSize As Integer = 100
Dim aryBLOB(intBuff erSize - 1) As Byte
Dim lngBLOB As Long
Dim lngStartIndex As Long = 0
Dim strBinaryFile As String

If Right(m_strDocu mentLocation, 1) = "\" Then
strBinaryFile = m_strDocumentLo cation & m_strDocumentNa me
Else
strBinaryFile = m_strDocumentLo cation & "\" & m_strDocumentNa me
End If

Try
ParamList(0) = SQLHelper.MakeI nParam("@Docume ntTypeID",
SqlDbType.Int, 4, 434)

dr = SQLHelper.GetDa taReader(Comman dType.StoredPro cedure,
"DocumentLo ad", ParamList)

If dr.Read Then
fs = New FileStream(strB inaryFile, FileMode.OpenOr Create,
FileAccess.Writ e)
bw = New BinaryWriter(fs )
lngStartIndex = 0
lngBLOB = dr.GetBytes(dr. GetOrdinal("doc ument"),
lngStartIndex, aryBLOB, 0, intBufferSize)

Do While lngBLOB = intBufferSize
bw.Write(aryBLO B)
bw.Flush()
lngStartIndex += intBufferSize
lngBLOB = dr.GetBytes(dr. GetOrdinal("doc ument"),
lngStartIndex, aryBLOB, 0, intBufferSize)
Loop

bw.Write(aryBLO B)
bw.Flush()
bw.Close()
fs.Close()
bw = Nothing
fs = Nothing
End If
Finally
If Not dr Is Nothing Then
dr.Close()
dr = Nothing
End If
SQLHelper.Dispo se()
End Try
End Sub

"Ramesh" <Ra****@discuss ions.microsoft. com> wrote in message
news:F7******** *************** ***********@mic rosoft.com...
How to read a BLOB from oracle 8i using OleDb

Jul 21 '05 #2

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

Similar topics

7
7103
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and disadvantages of using a MySQL blob field rather than reading the images directly from the file? How does one insert an image into a blob field? Can it be done dynamically? Thank you John
3
6445
by: Johan Vervoort | last post by:
How can I read a binary value from a blob via ODBC (Microsoft VFP driver-win32all)? The value seems to be truncated at the first '\0' TIA
5
2082
by: ssp | last post by:
Dear all, I'm dealing with a very tricky problem and can't seem to find the answer with google. the problem is: i want to store huge data (binaries) inside a mysql databases blob - to later store those data to a file somewhere else (from where i can connect the database). problem comes into play, when I try to output a "progress" of the reading of this data (kind of "xx bytes of XXX bytes already transmitted").
1
6533
by: sid_mulpuru | last post by:
I am trying to read data from a DB2 Blob Data type Field (using wsad 5.1.0) using getBlob() which when executed gives an SQL Exception 2005-01-07 15:48:40,506 ERROR - Error in servlet:xxxxx.jsp initiateDownloadFri Jan 07 15:48:39 CST 2005com.ibm.db2.jcc.a.SqlException: 1 (in debug mode exception called at rs =
0
1194
by: arbidol | last post by:
i want to read and write blob data from access2000 using dao3.6, but i found it is slower than ado. As i know, reading access with dao is the best way, what happens? the mdb file i want to read contains a table with 150000 rows and a blob field, i wish to fetch all rows in 3-4 secondes. What can i do, improving the speed of i/o read and write or improving the number of page buffer pool ?
1
3304
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. However, when I try to access the same page from another machine or when I test the code on a remote server the images just wouldn't show. The page I am talking about has 3 Image web controls. In the CodeBehind I am loading these controls by using an...
0
1472
by: MdAZ | last post by:
We need to read and store BLOB's as storage object in MS Access databases via OLE DB. We have used several methods but no one was succesfull. If one tries the code supplied under the article "Getting BLOB Data with Storage Object" of the MSDN library, IAccessor::CreateAccessor returns an error code and sets DBBINDSTATUS to DBBINDSTATUS_NOINTERFACE for the column that contains the BLOB even though DBCOLUMNFLAGS_ISLONG is set for this...
1
2114
by: Ken | last post by:
Hello, I'm trying to read a Blob from Oracle and then write it to an audio file(.AU). I'm using Visual Studio.Net 2003 (VB). I can't seem to get my code to work. Will someone take a look at it and tell me what am I doing wrong. Any help would be appreciated. Thanks Dim Conn As OracleConnection = New OracleConnection("data source=XXXX;user id=XXXXX;password=XXXXX")
2
3758
by: Chucker | last post by:
Hi Community, I think I can store Binary Data in SQL Server but when I try to retrieve it, I always only get one byte. I think I stored my Binary Data in SQL Server in a Colum of Type Image. At least when I execute the following code, I get some significant network traffic. When I check the database with query analyzer, I see 4 Hex Chars in the image colum. Like 0xe0 etc.
0
1323
by: Ken | last post by:
Hello, I'm trying to read a Blob from Oracle and then write it to an audio file(.AU). I'm using Visual Studio.Net 2003 (VB). I can't seem to get my code to work. Will someone take a look at it and tell me what am I doing wrong. Any help would be appreciated. Thanks Dim Conn As OracleConnection = New OracleConnection("data source=XXXX;user id=XXXXX;password=XXXXX")
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9601
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10637
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10379
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7660
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4332
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
3
3014
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.