aspx中如何显示access中ole对象字段的图片

来源:百度知道 编辑:UC知道 时间:2024/05/26 05:23:01
aspx中如何显示access中ole对象字段的图片

public static byte[] ReadByteFromDB(OleDbConnection connection, CommandType commandType, string commandText)
{
byte[] FileCont = null;
try
{
FileCont = (byte[])OleHelper.ExecuteScalar(connection, commandType, commandText);
}
catch (System.Exception e)
{
DebugUtil.Error("ReadFileFromDB:" + e.Message);

}
return FileCont;

}

OleHelper.ExecuteScalar()这个函数可以参考微软的SqlHlper.cs

读到了byte[]类型的 FileCont后,把它转为stream.然后就可以转为file,或是直接显示了