如何以可存储在数据库中的字节形式在datagridview中插入图像 [英] how to insert image in datagridview in byte form that can be store in database

查看:98
本文介绍了如何以可存储在数据库中的字节形式在datagridview中插入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以字节形式在datagridview中插入图像,该图像可以存储在数据库中.

how to insert image in datagridview in byte form that can be store in database

推荐答案

将图像存储在数据库的Blob字段中.

-在数据库中声明一个varbinary(max)类型的字段(如果它是sql server).

1)声明一个Image类型的对象,并将图片文件加载到该Object中.
2)获取该对象并将其存储在数据库中.

以下是一些链接:

使用Microsoft .NET从SQL Server存储和检索图像 [ ^ ]





http://support.microsoft.com/kb/316887/zh-CN [ ^ ]




http://www.dotnetgallery.com/kb/resource21-How-to-store-and-retrieve-images-from-SQL-server-database-using-aspnet.aspx [ ^ ]
Store the image in a Blob field in the database.

- Declare a Field of type varbinary(max) in the database (if it is sql server).

1) Declare an object of type Image and load the picture file into that Object.
2) Take that Object and store it in the database.

Here are some links:

Storing and Retrieving Images from SQL Server using Microsoft .NET[^]


and


http://support.microsoft.com/kb/316887/en-us[^]

and


http://www.dotnetgallery.com/kb/resource21-How-to-store-and-retrieve-images-from-SQL-server-database-using-aspnet.aspx[^]


这篇关于如何以可存储在数据库中的字节形式在datagridview中插入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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