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

ADO.NET: GETCHUNK & APPENDCHUNK

ADO has GetChunk & AppendChunk, features that are not supported by ADO.NET.

Is there a workaround in ADO.NET?
I am trying to write large files to LOB fields in a database table.
Dec 17 '07 #1
2 6836
When reading data from the database, call ExecuteReader on the
SqlCommand you are issuing, passing CommandBehavior.SequentialAccess. This
will allow you to call GetBytes or GetChars, specifying the range of bytes
you want to read from the database.

Granted, you have the option of reading the entire contents from the
database as well into a byte array.

There is no equivalent to write the data to the database. You will have
to place the data into a byte array and pass that byte array as a parameter
to whatever method you are using to save the data to the database. Granted,
the story here could be a little better, since for very large pieces of
data, it's not practical to load the complete contents into memory.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"AA2e72E" <AA*****@discussions.microsoft.comwrote in message
news:68**********************************@microsof t.com...
ADO has GetChunk & AppendChunk, features that are not supported by
ADO.NET.

Is there a workaround in ADO.NET?
I am trying to write large files to LOB fields in a database table.
Dec 17 '07 #2
For an example of writing in chunks:
http://groups.google.co.uk/group/mic...4e7e3782e59a93

Note that this does one round-trip per chunk, so you might want to
upsize the chunks a little - but try to stay in multiples of 8040 for
best performance. The example uses the older SQL syntax;
varbinary(max)/etc have slightly different syntax.

Marc
Dec 18 '07 #3

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

Similar topics

0
by: Bill | last post by:
Hi all, I have an asp page that writes to an ntext field in SQL Server 2000. All was going well until I had to put in a section of text greater than 8000 bytes. Then I got a timeout error and...
1
by: Bill | last post by:
Hi all, I have an asp page that writes to an ntext field in SQL Server 2000. All was going well until I had to put in a section of text greater than 8000 bytes. Then I got a timeout error and...
1
by: John Hoffman | last post by:
Hello I have a legacy SQL Database that uses ADO and AppendChunk to store a BLOB of data in a column. It was written in C++ I am now trying to retrieve that data back using C# and a DataReader...
1
by: Bill Hutchison | last post by:
I'm having trouble getting more than 2000 characters into an Oracle 10g CLOB column, and was trying to use the AppendChunk method in Access 97. I guess I haven't broken the code yet, since I still...
16
by: Mark | last post by:
Hello. I am attempting to use AppendChunk() to write binary data to a memo field in Access 2000. My initial call to AppendChunk() results in a data type conversion error. Any suggestions? Here...
2
by: Stan Smith | last post by:
I couldn't decide which newsgroup to post this in so I thought I would start here. I can create an "OLE Object" field manually in Microsoft Access and insert an Excel spreadsheet or a Word...
0
by: Mark | last post by:
I have a VB 6 program that I have saved an audio file to using the appendchunk as is shown at http://support.microsoft.com/kb/103257/EN-US/. I have it working fine in that app. The issue is...
1
by: Zrod | last post by:
hi. i need to be able to save documenets (files) in an sql binary field. i don not know in advance teh typt of document, Anyone can help ion writing the code required? Thanks
0
by: xkp | last post by:
Hi all, i just had to install the 5.0 version of mysql. previously i used an old 3."something" (my server crashed so i dont remember the precise version). I used to access mysql database using...
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:
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
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
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...
0
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...

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.