我从数据库中读取图片时显示乱码,是怎么回事?请问怎么解决? 我从数据库中读取图片时显示乱码,是怎么回事?请问怎么解决? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Response.ContentType="image/Png"Response.BinaryWrite(objMemoryStream.ToArray()) 以下就是我的代码:string strSQL="select * from resource where resource_id=8"; string strConn="Password=jj,2727;Persist Security Info=True;User ID=sa;Initial Catalog=fzjx;Data Source=zhh-m"; SqlConnection myConnection=new SqlConnection(strConn); myConnection.Open(); SqlCommand myCommand=new SqlCommand(strSQL,myConnection); SqlDataReader myReader = myCommand.ExecuteReader(); if(myReader.Read()) { Response.ContentType=myReader["format"].ToString(); //告诉IE文件的MIME类型 Response.OutputStream.Write((byte[])myReader["content"], 0, (int)myReader["length"]); } SQL数据库中的数据突然加载不上数据呢? 跪求正则高人 看看怎么写 这个取数据的 我只取到一部分数据 AjaxPro无刷新树在VS2003正常,在VS2005中无法加载的问题,附原码! 执行存储过程的问题 有没有人使用过log4net啊 如何才能不让用户看到源代码 Response.Redirect可不可以在新页面打开? 如何解析,我看了好几天了,没有效果啊 整合图片上传,以及生成缩略图,还有同时上传附件的思路 关于提交时的验证 好烦人的问题哦 ! 新窗体的问题
Response.BinaryWrite(objMemoryStream.ToArray())
string strSQL="select * from resource where resource_id=8";
string strConn="Password=jj,2727;Persist Security Info=True;User ID=sa;Initial Catalog=fzjx;Data Source=zhh-m";
SqlConnection myConnection=new SqlConnection(strConn);
myConnection.Open(); SqlCommand myCommand=new SqlCommand(strSQL,myConnection); SqlDataReader myReader = myCommand.ExecuteReader();
if(myReader.Read())
{
Response.ContentType=myReader["format"].ToString(); //告诉IE文件的MIME类型 Response.OutputStream.Write((byte[])myReader["content"], 0, (int)myReader["length"]); }