将文档文件存储在sql server数据库中 [英] store doc file in sql server database

查看:155
本文介绍了将文档文件存储在sql server数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生您好,
我在docarea框中存储了包含应聘者简历的doc文件.我需要将其进一步存储到数据库中.我正在做,但是并没有以使用varchar(max)数据类型

hello sir,
i am storing doc file which contains resume of candidate''s in textarea box. i need to stored this further into database.i am doing but that''s n''t stored in the same format which''s stored in .doc file.m using varchar(max) data type

推荐答案

如果它是一个文本框,那么您所拥有的是文本,而不是.doc文件.因此,我看不到问题,除非您具有Unicode字符并需要使用nvarchar.

到底是什么问题? doc文件来自哪里?你创造它吗?如果需要存储二进制文件,为什么不能更改数据库格式?
If it''s a textbox, then what you have is text, not a .doc file. So, I don''t see the issue, except if you have unicode characters and need to use nvarchar.

What is the problem exactly ? Where do the doc file come from ? Do you create it ? Why can''t you change the database format if you need to store a binary file ?



正在保存
**********
1.首先将文档内容转换为字节数组.
2.将数组数据保存到数据库中.

检索
***********
1.从数据库中检索数据.
2.将其转换为字节数组.
3.将数据从字节数组转换为文件流.
4.使用适当的应用程序打开内容:)
Hi
saving
**********
1.first convert the document content in to array of bytes.
2. saving array data in to database.

retrieving
***********
1. retrieve the data from the database.
2. convert it into array of bytes.
3. convert the data from array of bytes to filestream.
4. open the conten using appropriate application :)


这篇关于将文档文件存储在sql server数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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