tags:

views:

325

answers:

1

I have c# application which write files to sqlite database. It uses entity fraemwork for modeling data. Write file to blob (entity byte[] varible) with this line:

row.file = System.IO.File.ReadAllBytes(file_to_load.FileName); //row.file is type byte[]
                                                               //row is entity class table

All work correctly when files size is less. When size more 300Mb app throw exception: Exception of type 'System.OutOfMemoryException' was thrown.

How I can write to blob direct, without memory varibles?

A: 

You'll have to use so-called Incremental BLOB I/O. See this post on a System.Data.SQLite forum.

Anton Gogolev