想要从数据库中保存和检索图像
问题描述:
你好,
谁能帮我,将图像保存到数据库中以及从数据库中检索该图像.我需要执行此操作的查询.
Hello,
Can anyone help me, for saving a image into database and for retrieving that image from database. I need the query for doing this.
答
检查以下链接
C#从数据库中保存和加载图像
http://www.shabdar.org/sql-server/105-store-save-images-in-sql-server.html
http://www.dotnetcurry.com/ShowArticle.aspx?ID=129
http://www.dotnettutorials.com/tutorials/database/save-retrieve-image- cs.aspx
http://www.c -sharpcorner.com/uploadfile/dbeniwal321/从使用C-Sharp到数据库的读取和保存图像/
check following links
C# Save and Load Image from Database
http://www.shabdar.org/sql-server/105-store-save-images-in-sql-server.html
http://www.dotnetcurry.com/ShowArticle.aspx?ID=129
http://www.dotnettutorials.com/tutorials/database/save-retrieve-image-cs.aspx
http://www.c-sharpcorner.com/uploadfile/dbeniwal321/reading-and-saving-images-fromto-a-database-using-C-Sharp/
您可能会看我的文章是否有帮助...
从数据库到Gridview的显示/存储和检索图像数据
祝您编程愉快...
Hi,
You may see my article if could help...
Display/Store and Retrieve Image Data from Database to Gridview
Happy coding...
尝试一下,
在数据库中有一列数据类型为 varbinary 的列,将图像转换为 字节 并将其存储在数据库中.
进行检索的同时,将内容放入字节数组并将其写入具有图像扩展名的文件中,然后就可以使用该图像.
try this,
have a column with a datatype varbinary in the database,convert the image to bytes and store it in the database.
while retriving get the thing in a byte array and write it to a file with image extension then you can use the image.