イメージとテキスト行を出力しようとしたときに、私が間違っているイメージしか表示されないのはなぜですか?Response.Write出力の問題
SqlConnection cn = new SqlConnection("CONNECTIONINFO HERE");
SqlCommand cmd = new SqlCommand("SELECT * FROM test WHERE id=" + Request.QueryString["id"], cn);
cn.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read()) //check to see if image was found
{
Response.ContentType = dr["fileType"].ToString();
Response.BinaryWrite((byte[])dr["imagesmall"]);
Response.Write("<br/>This is your image, if this is incorrect please contact the administrator.");
}
cn.Close();
「ContentType」は何に設定されていますか? – Patrick