I’m using DocX to create .docx files. Instead of storing them on hard drive, Share or SharePoint i would prefer to store them inside SQL Database. So my questions are:
- How to write proper code to save file to that database?
- How to write proper code to retrive file to that database?
- What kind of datatype should i set for a table to hold the docx files? Is it Image?
With regards,
MadBoy
PS. I would prefer a proper code in terms of using Using the old ‘school’ way:
using (var varConnection = Locale.sqlConnectOneTime(Locale.sqlDataConnectionDetailsDepozyt))
using (var sqlQuery = new SqlCommand(preparedCommand, varConnection))
using (var sqlQueryResult = sqlQuery.ExecuteReader())
while (sqlQueryResult != null && sqlQueryResult.Read())
A docx file is like a zip file which is collection of several files. What about converting into binary and then saving into DB
Something as followswill work
To save
Retrieval is a bit complicated process as follows
Have look at following articles for help and details
Saving:
Retreival :