数据库中有以<Binary>存贮的图象。
怎样将它显示出来?

解决方案 »

  1.   

    将它先读到缓冲区image,然后将image显示出来
      

  2.   

    参考以下示例你在A页面中这样写:
    <img src=show.aspx?id=xx>然后在b页面如下写string id = this.Request.QueryString["id"];
    OleDbCommand myCommand = this.conn.CreateCommand();
       string sql = "select fileblob,filemime from table where id = " + id;
       myCommand.CommandText = sql;
       OleDbDataReader myRead = myCommand.ExecuteReader();   //开始读取
       if(myRead.Read() == true)
       {
        Byte[] Buffer = (Byte[])myRead[0];    //输出
        this.Response.Clear();
        this.Response.ContentType = myRead[1].ToString();
        this.Response.BinaryWrite(Buffer);
        this.Response.End();
    }