try
{
SqlDataReader sdr=cmdsearch.ExecuteReader();
while(sdr.Read())
{
this.textBox2.Text=sdr["carname"].ToString().Trim();
this.textBox3.Text=sdr["wdatetime"].ToString().Trim();
this.textBox4.Text=sdr["location"].ToString().Trim();
this.textBox5.Text=sdr["wcode"].ToString().Trim();
this.textBox6.Text=sdr["imagecode"].ToString().Trim();
this.textBox7.Text=sdr["pudatetime"].ToString().Trim();
this.textBox8.Text=sdr["beizhu"].ToString().Trim();
FileInfo fi=new FileInfo("temp");
FileStream myStream=fi.Open(FileMode.Create);
byte[] mydata=((byte[])sdr["imageinfo"]);
foreach(byte a in mydata)
{
myStream.WriteByte(a);
}
myStream.Close();
Image myImage=Image.FromFile("temp");
pictureBox1.Image=myImage;
pictureBox1.Refresh();
// sdr.Close()
// this.Dispose();
}
上面这段代码在运行时只能运行一次,可 不可以帮忙看看