类似
http://dotnet.aspx.cc/ShowDetail.aspx?id=ECD9AE16-8FF0-4A1C-9B9F-5E8B641CB1B1

解决方案 »

  1.   

    这个字段是image型,不是字符型的,这样好像是读不出来
      

  2.   

    http://dev.csdn.net/article/28/28352.shtm
      

  3.   

    设置image的ImageUrl为"LoadRPhoto.aspx"
    在LoadRPhoto.aspx中加载图片:
    private void LoadNoPicture()//加载默认照片
    {
    System.IO.FileStream imgFStream = new System.IO.FileStream(this.Server.MapPath(".") + "\\pic\\NoPhoto.gif",System.IO.FileMode.Open,System.IO.FileAccess.Read);//声明一个公开以文件为主的流
    System.IO.BinaryReader imgBReader = new System.IO.BinaryReader(imgFStream);
    System.Byte[] imgBinaryData = imgBReader.ReadBytes(System.Convert.ToInt32(imgFStream.Length));
    this.Page.Response.BinaryWrite(imgBinaryData);
    } private void LoadCadaverPhoto(string p_BodyId,string p_Serialer)//加载照片
    {
    try
    {
    this.OraConnData.Open();
    System.Data.OracleClient.OracleCommand OraAdaLoadCadaverPhoto = new System.Data.OracleClient.OracleCommand("SELECT PHOTO FROM CASE_S_WMSTPHOTO WHERE BODYID = '"+p_BodyId+"' AND SERIALER = '"+p_Serialer+"'",this.OraConnData);
    System.Data.OracleClient.OracleDataReader OraDrLoadCadaverPhoto = OraAdaLoadCadaverPhoto.ExecuteReader();
    if(OraDrLoadCadaverPhoto.Read())
    {
    System.Web.HttpContext.Current.Response.ContentType = "images/*";
    if(OraDrLoadCadaverPhoto["PHOTO"].ToString().Trim() != "")
    {
    this.Page.Response.BinaryWrite((byte[])OraDrLoadCadaverPhoto["PHOTO"]);
    }
    else
    {
    this.LoadNoPicture();
    }
    }
    else
    {
    this.LoadNoPicture();
    }
    }
    catch
    {
    this.LoadNoPicture();
    }
    finally
    {
    this.OraConnData.Close();
    }
    }
      

  4.   

    int1 = Trim(Request.QueryString("编号"))
            SqlConnection1.ConnectionString = "user id=sa;data source=wiecoffice;persist security info=False;initial catalog=wiecweb;password=" & Trim(name)
            SqlCommand1.CommandText = "select * from 商品 where 编号='" & Trim(CType(int1, String)) & "'"
            SqlConnection1.Open()
            SqlCommand1.Connection.Open()        Dim Sqldatareader1 As System.Data.SqlClient.SqlDataReader = SqlCommand1.ExecuteReader(CommandBehavior.CloseConnection)
            If Sqldatareader1.Read() Then
                Response.BinaryWrite(Sqldatareader1.Item("image"))
    我这样写,怎么读不出来