small c# helper class for storing/streaming files to SQL Compact Edition (CE) database
$30-100 USD
In Progress
Posted about 15 years ago
$30-100 USD
Paid on delivery
We need a C# helper class for SQL compact edition and a specialized table for storing files in a DB:
In particular
the table needs to have the following fields:
long id; (auto incremented)
Blob (Image) File;
string FileName;
DateTime timeStamp; (should be set automatically at insertion with the current Time).
The tricky part is that we need support for STREAMING files in and out of the DB. There is some help available on the internet for this...
The following article can be useful:
[login to view URL]
In particular [login to view URL] should be used.
## Deliverables
We need a C# helper class for SQL compact edition and a specialized table for storing files in a DB:
In particular
the table needs to have the following fields:
long id; (auto incremented)
Blob (Image) File;
string FileName;
DateTime timeStamp; (should be set automatically at insertion with the current Time).
The helper class needs to expose the following methods.
-method to create the table
-Stream GetFileStream(long id);
-long InsertFile(Stream fileContents,string name); returns the id (use select @@Identity);
delete all entries from the table.
The key difficulty is NOT to read the entire file into memory!!! Proper streaming must be used since our applications will be manipulating large files.
A small command line test Application is required to demonstrate. The test program should generate a large file (say 10Mb) and use the Insert method to stream it into the DB. it should then reread it using GetFile, save to a second file and compare the contents to check they are equal. There is some info in the net on how to use the Image type to accomplish the streaming.
* * *This broadcast message was sent to all bidders on Tuesday Feb 17, 2009 8:37:08 AM:
some people requested info on streaming to DB, I added to the description, here is a link which should help a lot. [login to view URL]