如何从数据库中检索图像

编程入门 行业动态 更新时间:2024-10-28 04:17:48
本文介绍了如何从数据库中检索图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何从数据库中检索图像并保存到文件夹中(在项目中或在计算机中)我在数据库中以字节的形式存在10000多个图像。

解决方案

只需选择它们,然后将返回的值转换为字节数组。 然后你就可以使用 File.WriteAllBytes [ ^ ]创建具有相应扩展名的文件的方法。 对于这个数量的图像,我可能会使用DataReader而不是DataAdapter来节省内存,并且在BackgroundWorker中执行任务,因为这将是一个耗时的过程。

how to retrieve images from database and save into a folder (with in project or in computer) i have more than 10000 images in database in the form of bytes.

解决方案

Just SELECT them, and cast the returned value into an array of bytes. You can then just use File.WriteAllBytes[^] method to create a file with the appropriate extension. For that number of images, I'd probably use a DataReader rather than a DataAdapter for save memory, and do the task in a BackgroundWorker as it's going to be a time consuming process.

更多推荐

如何从数据库中检索图像

本文发布于:2023-10-28 05:39:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535690.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库中   图像

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!