views:

73

answers:

1

I am creating a desktop application that stores rich text documents to a SQL Compact database. Documents are converted to a byte array and stored as a Binary column, and I am running into SQL Compact's 8K limit for Binary field length.

Is there a simple way to get around the 8K limit? I can come up with lots of complicated ways to do it, such as parsing into 8K chunks for storage and reassembling on fetch. But before I get into something that complex, I would like to make sure I can't solve the problem more simply, such as by changing data type.

If there is no simple way of getting around the 8K limit, is thare a best practice for storing documents greater than 8K? Thanks for your help.

+2  A: 

You'd use image data type, no?

gbn
That will only work until he runs into the 1,073,741,823 byte limit.
MusiGenesis
@MusiGenesis: \*lol\*
Tomalak
ROFL--thanks for saving me a lot of work! I *think* a gigabyte should be sufficient to hold a document! I am using Entity Framework 4, so I'll need to verify that the Image data type will work. But you answered the question that I ask, so it gets my acceptance!
David Veeneman