如何在mvc3 razor视图中保存和检索sql数据库中的图像

问题描述:

我在数据库中以二进制格式存储了一些图像,现在我想在我的视图中显示这些图像,我们如何将这些图像从二进制格式再次转换为图像格式?和图像应该显示在webgrid

Hi, I stored few images in database in binary format, now i want to display those images in my view,how can we convert those images from binary format to image format again? and images should be display in "webgrid"

我昨天发表了一篇关于此的文章:

使用EF在SQL Server中监控二进制数据 [ ^ ]



这完全符合您的需求。
I Posted an article about this yesterday :
Storing binary data in SQL Server using EF[^]

This will totally fit your needs.