実際、次の方法でデータベースに保存<Binary data>
しました:
HttpPostedFile PostedFile = Request.Files[m + 2];
byte[] fileData = null;
using (var binaryReader = new BinaryReader(Request.Files[m + 2].InputStream))
{
fileData = binaryReader.ReadBytes(Request.Files[m + 2].ContentLength);
}
今、私は画像で表示したかった<Binary data>
。次のようなビットコードを使用しました:
ASPxImage objimg = new ASPxImage();
objimg.ID = "objimg" + (j + 1);
objimg.Width = 100;
objimg.Height = 100;
byte[] buffer = null;
buffer = (byte[])DtChoices.Rows[j]["COLUMN_IMAGE"];
MemoryStream ms = new MemoryStream(buffer);
objimg.Value = System.Drawing.Image.FromStream(ms);
しかし、画像を表示できません。誰か助けてくれますか?