M
M
Michael Vasyukov2017-11-01 01:02:12
Database
Michael Vasyukov, 2017-11-01 01:02:12

How to add a file to the access database, and then get it?

Hi all! The following question arose: There is an access database on the computer, it has 2 tables (1 - with text data, 2 - with files), so the 2nd table is empty and I need to do it programmatically (using C#) in 2 -th table could be transferred files (namely, the files will be word ) it is necessary not to specify a link to the file, but to copy the file itself to the database, and if the database itself was transferred to another PC, these files could be used programmatically (C# is the same program ).
PS Thank you all!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cicatrix, 2017-11-01
@programmer_developer

Read the file into a byte array, then insert it into a binary, abinary, or bigbinary field.
You read by normal select and write to a file.
Yes, you also need to save the file name and its attributes (if that matters).
But in general, if possible, I would replace Access with any other RDBMS (SQLEXPRESS, for example, can be perfectly handled with C #).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question