当前位置: 首页 > 编程语言 > C#

从SQLServer数据库中检索图像Share

时间:2023-04-10 12:00:33 C#

从SQLServer数据库中检索图像我正在将图像存储到数据库中。如何从数据库中检索所有图像。例如:Selectimagefromimagetable问题:数据逻辑:while(dr.Read()){///Checkfornullif(!dr.IsDBNull(0)){try{///将图像转换成位图byte[]照片=(byte[])dr[0];ms=newMemoryStream(照片);位图bm=新位图(毫秒);bmp[i]=bm;关闭();}catch(Exceptionex){}}ASpx.CS页面:Bitmap[]bm=photos.GetImage();for(inti=0;i