上传的过程如下:
HttpPostedFile upPhoto=UpPhoto.PostedFile;
int upPhotoLength=upPhoto.ContentLength;
byte[] PhotoArray=new Byte[upPhotoLength];
Stream PhotoStream=upPhoto.InputStream;
PhotoStream.Read(PhotoArray,0,upPhotoLength);
Response.Write(PhotoArray.ToString()); config conn=new config();
try
{
conn.open();
string sql="insert into aa values(@FImage)";
SqlCommand cmd=new SqlCommand(sql,conn.conns);
cmd.Parameters.Add("@FImage",SqlDbType.Image);
cmd.Parameters["@FImage"].Value=PhotoArray;
cmd.ExecuteNonQuery();
}
catch(Exception ex)
{
ErrorLog(ex.Message.ToString());
Server.Transfer("ErrorPage.aspx?ErrMsg=Wrong!",true);
}
?怎么样把sql数据库里IMAGE类型的图片,读取到.NET的IMAGE控件中去。