blob into sql database

H

Hrvoje Voda

How to insert a blob arraylist into database?

I know it's not good, but my customers want that, so if someone has some
simple example of how to do it...

Hrcko
 
W

William Stacey [MVP]

With sql 2005 this is not such a bad thing to do any longer. They also have
varbinary(max) where you can just pass a byte[] or SqlBinary(I think) to a
stored proc using the sqlclient. For large byte[] (i.e. MBs or GBs) you
can't just load them in memory to pass, so you need to chunk it up.
Chunking down is on msdn and is ~easy, but a chunking upload to the db is a
bit more work. I have an up/down sample I did using varbinary(max) and new
..Write with Update TSQL/SP few weeks ago. I will try to get it up on my
blog. Any interest?
 
W

William Stacey [MVP]

I managed to work up a sample at:
http://spaces.msn.com/members/staceyw/Blog/cns!1pnsZpX0fPvDxLKC6rAAhLsQ!404.entry
Note this is for SQL2005 using the new varbinary(max) datatype to store the
file in the DB column.
One thing missing in SQL2005 is a way to stream-UP byte[]s like you can
stream-down using sequential access. So we still need to chunk the data on
uploads of large files/byte[]s. hth

--
William Stacey [MVP]

William Stacey said:
With sql 2005 this is not such a bad thing to do any longer. They also
have varbinary(max) where you can just pass a byte[] or SqlBinary(I think)
to a stored proc using the sqlclient. For large byte[] (i.e. MBs or GBs)
you can't just load them in memory to pass, so you need to chunk it up.
Chunking down is on msdn and is ~easy, but a chunking upload to the db is
a bit more work. I have an up/down sample I did using varbinary(max) and
new .Write with Update TSQL/SP few weeks ago. I will try to get it up on
my blog. Any interest?

--
William Stacey [MVP]

Hrvoje Voda said:
How to insert a blob arraylist into database?

I know it's not good, but my customers want that, so if someone has some
simple example of how to do it...

Hrcko
 

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