一个小问题,从昨天烦到我今天了
string   strId	=   Request.QueryString[ "id "].ToString()   ; 
 DataSet   dsCount	=   new   DataSet()   ; 
 dsCount	=   (new   DACommonFunctionSystem()).GetDataSetBySql( "select   count(*)   as   a   from   vehicleimage   where   VclImageID= "   +   strId)   ; 
 if(Convert.ToInt32(dsCount.Tables[0].Rows[0][ "a "])!=0) 
 { 
 DataSet   ds	=   new   DataSet()   ; 
 ds   =   (new   DACommonFunctionSystem()).GetDataSetBySql( "select   *   from   vehicleimage   where   VclImageID= "   +   strId)   ;//查取对应的图片信息 
 System.Byte[]   Photo   =   (byte[])ds.Tables[0].Rows[0][ "VclImage "]; 
 Response.ContentType= "image/pjpeg ";    
 Response.OutputStream.Write(Photo,   0,   Photo.Length); 
 Response.End();    
 } 
 else 
 {}   
 我先在要把图片显示在Image控件上 
 那为大哥帮忙给小弟说说,要加个Image控件代码怎么该 
------解决方案--------------------吧 Image 放在临时文件夹 然后 IMage控件的URL指向那个临时文件夹
------解决方案--------------------新建一个页面。用你的代码把图片输出到这个页面中。 
 把Image的URL指向这个页面就可以了
------解决方案--------------------System.Byte[] Photo = (byte[])ds.Tables[0].Rows[0][ "VclImage "]; 
 Response.ContentType= "image/pjpeg ";  
 Response.OutputStream.Write(Photo, 0, Photo.Length); 
 Response.End();  
 就这几句已经吧这个aspx页面写成图片了,只不过扩展名还是aspx,你就当这个页面是个图片好了,假如这个页面叫a.aspx,你另外页面的image控件的neigtiveUrl=a.aspx?id=XX就行 
------解决方案--------------------你试试这个: 
 byte[]   b=new   byte[1];    
   System.Data.SqlClient.SqlDataReader   dr=cm.ExcuteDataReader();    
   if(dr.read())    
   {    
   b=(byte[])dr[ "imagefield "];    
   }    
   System.IO.MemoryStream   ms=new   System.IO.MemoryStream();    
   ms.Write(b,0,b.Length-1);    
   this.Image1.Image=new   System.Drawing.Bitmap(ms);
------解决方案--------------------朋友,不要烦。因为这样解决不了问题。答案会有的,面包会有的。