ADO.NET: GETCHUNK & APPENDCHUNK

A

AA2e72E

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top