这是我的代码;我尝试检索图像。我试着解决但失败了:
SqlCommand cmd = new SqlCommand("select pic from pic where idimg= '" + listBox1.Text + "'", con);
SqlDataReader r;
con.Open();
r = cmd.ExecuteReader();
while (r.Read())
{
byte[] storedImage = (byte[])(r["pic"]);
MemoryStream ms = new MemoryStream(storedImage);
pictureBox1.Image = Image.FromStream(ms); // Error :Parameter is not valid
}
r.Close();
con.Close();
答案 0 :(得分:0)
参数无效只是show.while图像保存在没有给定边界的数据库上且没有错误生成从DB检索时发生错误