我用winform做学生管理系统,有一个存图片,我存进去之后能取出来,但是修改的时候,修改完之后。发现修改过后的图片不能看,数据库里有显示二进制文件,求解
string sqlupdate = "Update StudentInfo Set Picture=@photo where StudentID='"+label14.Text.ToString()+"'";
            SqlConnection con = new SqlConnection(Helper.sql);
            con.Open();
            SqlCommand command = new SqlCommand(sqlupdate, con);
            command.Parameters.Add("@photo", SqlDbType.Image, convert(img).Length);
            command.Parameters["@photo"].Value = convert(img);
            int i = command.ExecuteNonQuery();
            if (i > 0)
            {
                MessageBox.Show("修改成功");
            }
            else
            {
                MessageBox.Show("修改失败");
            }
            con.Close();
 //二进制转换
        public byte[] convert(string photo)
        {
            FileStream file = new FileStream(photo,FileMode.Open,FileAccess.Read);
            byte[] bytes = new byte[photo.Length];
            file.Read(bytes, 0, bytes.Length);
            file.Close();
            return bytes;
        }winform数据库