我不明白为什么当我尝试在下面输出图像和一行文本时,我只得到图像我做错了什么?
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();