简体   繁体   中英

How to convert SQL Server image type to normal text in c#?

In our Database, doc and pdf files content has been stored as image datatype in SQL server. But now I want to convert to original format .doc and .pdf files. Can anyone please help me how to do this in c#. Thanks

You need an additional variable (field/column) in your database which stores the original filename with extension. Then you can simply copy all the bytes form the database (variable/cell/field) to a new file and name it accordingly.

This will restore the original file with a matching file extension.

Converting such a file to text is quite another story.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM