如何在图像数据类型字段中的数据库表中保存条形码图像。 [英] How to save the Barcode image in a database table in image data type field.

查看:92
本文介绍了如何在图像数据类型字段中的数据库表中保存条形码图像。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将数据库中生成的条形码图像保存到具有图像数据类型字段的表中。

I want to save generated barcode image in a database into a table with image data type field.

推荐答案

您需要创建位图来自 barCode 。然后将其转换为字节数组并存储在数据库中。



请在此处查看答案 - 将动态生成的条形码图像保存到ASP.Net中的数据库中 [ ^ ]。
You need to create Bitmap from the barCode. Then convert that to byte array and store in database.

See the answer here - Save dynamically generated Barcode image into database in ASP.Net[^].


考虑到性能和将来的维护,建议不要将映像直接存储在数据库中。最好将图像保存在磁盘上并将图像路径信息存储在数据库中。
Considering performance and future maintenance, it's not recommended that you store the image directly in database. It's better to save the images on disk and store the image path info in database.


这篇关于如何在图像数据类型字段中的数据库表中保存条形码图像。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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