数据库图片处理问题,为何有些图片出来,有些不出来
数据库图片处理问题,为何有些图片出来,有些不出来,
图片保存统一由另外的程序处理,通过分析图片格式为BMP
跟踪数据当参数为JA92087时图片出不来,而当参数为JA92088时图片出来了,
如果是数据库图片原因,我看是不可能的,因为图片保存到数据库是通过一个统一的程序处理的,其程序是用c++builder写的,我在用其他程序查询数据时,
JA92087和JA92088都存在有图片,而且速度反应很快
请帮我分析原因,或提供解决问题的思路,好吗?
调用图片代码
Response.Write("<img style="+'"'+"Z-INDEX: 1; LEFT: 406px; POSITION: absolute; TOP: 214px "+'"'+" ismap=true src="+'"'+"ReadImage.aspx?zcl="+HttpUtility.UrlEncode(zclname)+'"'+">");
ReadImage.aspx代码
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
String zclname=HttpUtility.UrlDecode(Request.QueryString["zcl"].ToString());
String c_sql;
String c_connect=Session["s_connect"].ToString();
SqlConnection mySQLConnection = new SqlConnection(c_connect);
mySQLConnection.Open();
c_sql="select Zcl,Picture FROM server_picture where Zcl='"+zclname+"'";
Trace.Write(c_sql);
SqlCommand MyCommand = new SqlCommand (c_sql, mySQLConnection);
SqlDataReader dr =MyCommand.ExecuteReader();
while(dr.Read())
{
//Response.ContentType ="bmp";
Response.BinaryWrite((byte[])dr["Picture"]);
}
mySQLConnection.Close();
}