显然不是这样子的,应该输出数据流!Response.ContentType="image/pjpeg";
Response.BinaryWrite(by);

解决方案 »

  1.   

    Sample:
    // Read picture into buffer
    byte[] bData=null;
    Bitmap picture;
    FileStream stream;// Create a new stream to load this photo into
    stream = new FileStream((string)dr["FullPath"], 
    FileMode.Open, 
    FileAccess.Read);
    // Create a buffer to hold the stream bytes
    bData = new byte[stream.Length];
    // Read the bytes from this stream
    stream.Read(bData, 0, (int)stream.Length);
    picture=new Bitmap(stream);
    // Now we can close the stream
    stream.Close();//Save it into DB
    string strQuery="Insert into yourTable ("
    //Fields list
    +"PhotoData) "//picture data field
    //Fields' value
    +"values("
    +"@PhotoData)";//Using parameter
    OleDbCommand oleComm=new OleDbCommand(strQuery,oleConn);
    oleComm.Parameters.Add("@PhotoData",PhotoData);
    oleComm.ExecuteNonQuery();
    oleComm.Dispose();
      

  2.   

    "PhotoData" is equal to "bData".