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

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.


"Sahil Malik [MVP]" <contactmethrumyblog@xxxxxxxxxx> wrote in message
news:eNtnGoqUFHA.3056@xxxxxxxxxxxxxxxxxxxxxxx
> How about if there were 5 rows, 50K blobs each?
>
> But I think I understand your point.
>
> - Sahil Malik [MVP]
> http://codebetter.com/blogs/sahil.malik/
>
>
> "William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxxx> wrote in message
> news:eZzzc5eUFHA.3244@xxxxxxxxxxxxxxxxxxxxxxx
>> 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.
>> __________________________________
>>
>> "Sahil Malik [MVP]" <contactmethrumyblog@xxxxxxxxxx> wrote in message
>> news:OTJbZ0BUFHA.616@xxxxxxxxxxxxxxxxxxxxxxx
>>> 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/
>>>
>>>
>>>
>>> "William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxxx> wrote in message
>>> news:#pYh5$AUFHA.584@xxxxxxxxxxxxxxxxxxxxxxx
>>>> 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.
>>>> __________________________________
>>>>
>>>> "ZhangZQ" <zhangzq71@xxxxxxxxx> wrote in message
>>>> news:u3weRcMTFHA.548@xxxxxxxxxxxxxxxxxxxxxxx
>>>> > 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
>>>> >
>>>>
>>>>
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Ideas on storing and retriving files in a Windows Application
    ... files etc. 2) Because it is stored in a relational database, ... blobs takes some minor modifications other than just using SELECT blah FROM ... horror stories of people who started storing BLOB data in a db only to have ... > will open the appropiatte application to display the file and 2. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Storing word documents, spreadsheets... in SQL database
    ... I'll believe WinFS when I see it. ... BLOBs require serialization so they can be transmitted to the server and stored as TEXT or IMAGE types in the database. ...
    (microsoft.public.vb.database)
  • Re: Ideas on storing and retriving files in a Windows Application
    ... about everything floating around in my mind. ... I know how to retrieve the data back from the database but I ... > blobs takes some minor modifications other than just using SELECT blah FROM ... > Have an opinion on the effectiveness of Microsoft Embedded newsgroups? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Blobs and SQL Server
    ... Yes, there is a performance hit while importing blobs, mainly disk and to a ... In general you store the blob in the database for manageability reasons. ... Looking for a SQL Server replication book? ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Timeout when inserting BLOB records
    ... how do you find storing this much blob data - is it better than storing ... > adding tif images as BLOBs to rows in a table in SQL2000. ... > The database holds approx 142,000 image records and the database size is ...
    (microsoft.public.sqlserver.programming)