使用C#将大文件上传到sql数据库. [英] Uploading large files into sql database using c#.

查看:459
本文介绍了使用C#将大文件上传到sql数据库.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



您能否建议我最好的方法,即使用c#将大型文件保存在数据库中而又不增加内存负担.

目前,我正在将文件读取到BinaryReader中并将其读取成块,然后将其发送到数据库.我在执行时会占用大量内存空间.因此,能否请您建议我一种最佳的方式来流式传输数据库数据,而不会对内存造成太大的压力.

在此先感谢
vallab

Hi,

Could you please suggest me the best way to save the huge files in the database using c# without putting the load on memory.

At present i m reading the file into BinaryReader and reading it into chunks and sending it to the database. I which takes lots of memory space while execution. So could you please suggest me the best possible way to stream the data database without putting so much pressure on memory.

Thanks in advance
vallab

推荐答案

vvr15写道:

能否请我建议最好的方法使用c#将庞大的文件保存在数据库中,而无需将负载放在内存上.

Could you please suggest me the best way to save the huge files in the database using c# without putting the load on memory.



您无法使用ASP.NET,因为只有一种机制可以将文件上传到网页中.但是使用客户端应用程序,您可以分块上传文件,因此不必一次全部将其存储在内存中.



you can''t, with ASP.NET, as only one mechanism exists to upload a file in a web page. But with a client app, you could upload the file in chunks, so it doesn''t all have to be in memory at once.


这篇关于使用C#将大文件上传到sql数据库.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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