如何从SQL 2005检索存储的文件 [英] How to retrieve the stored files from sql 2005

查看:59
本文介绍了如何从SQL 2005检索存储的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不同类型(pdf,doc,xls)的文件存储在sql 2005中.如何使用存储时的文件类型恢复文件.

Different type (pdf,doc,xls) of files are stored in sql 2005. How to get back into files with the type when they stored.

推荐答案

SQL Server对文件格式一无所知.它仅存储BLOB(二进制大对象).您以字节数组的形式从数据库中读取这些文件.您可以使用System.IO.File.WriteAllBytes( ... )将这样的数组保存到具有正确扩展名的文件中.
尼克
SQL Server doesn''t know anything about file formats. It just stores BLOBs ( Binary Large OBjects ). You read these from the database as an array of bytes. You can save such an array to a file with the right extension using System.IO.File.WriteAllBytes( ... ).

Nick


这篇关于如何从SQL 2005检索存储的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆