How to provide a feedback in accessing the BLOB type data?

  • Thread starter Thread starter ZhangZQ
  • Start date Start date
Z

ZhangZQ

How to let the user know the progress while accessing BLOB type data? The
feedback such as the number of bytes readed/written to database.


Regards,
ZhangZQ
 
Thank you very much! Very good, read BLOB data from database is ok, but how
about writting BLOB data to database? How to provide feedback in writting
BLOB data?

Regards,
ZhangZQ
 
Or you could follow the advice of many developers and keep BLOBs out of the
database...

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Okay, I'm gonna be a spoil sport and say - There is one big advantage to
keeping atleast small blobs in the database - "Backups".

But anyway, Blobs don't belong in the db. My yardstick is, if it's greater
than 50K, keep it on the filesystem.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/
 
Ah, backups are another reason to keep BLOBs out of the database. They make
the backup take longer, consume more space--and in too many cases these
BLOBs are RO so they don't change from time to time. It's far faster to copy
the files to a DVD and keep them safe there--once.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
I'll stay out of the discussion on whether it's a good idea to use BLOBs in
the database :)

To answer ZhangZQ's question below:

When fetching blobs from the server, you can do the following:
- use CommandBehavior.SequentialAccess, that will turn-off full-row
buffering in the reader so we'll pull data from the network on-demand, as
you consume it, even for values within the row.
- to fetch the value in chunks, use DataReader.GetBytes or
DataReader.GetChars with a buffer of some reasonable size (e.g. 10 or 20K,
experiment a little to find a good perf point). Between calls to
GetChars/GetBytes you can report progress.
- note that you cannot reliably know the length of the entire value
(sometimes we know it, sometimes we don't)

That will give you full streamig fetching, and you can report as you fetch.

As for sending *to* the server (in parameters), infortunately we don't have
streaming capabilities. You can send it in chunks (using WRITETEXT), but
that's painful and slow.

--
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.

This posting is provided "AS IS" with no warranties, and confers no rights.
 
William,
Or you could follow the advice of many developers and keep BLOBs out of
the database...
We don't agree in this, it is very nice to keep thumbnails in the database
from pictures who has as well their paths in the database.

You can than make very nice selection screens.

:-)

Cor
 
Back
Top