0
不好意思再问一次这个问题.. 我只是简化了这个问题.. 这是我的问题:无法投射'System.DBNull'类型的对象来为MySQL图像键入'System.Byte []'
的错误观点是
Dim image As Byte() = DirectCast(command.ExecuteScalar(), Byte())
的代码是
Dim stream As New MemoryStream()
Dim command As New MySqlCommand("select Imageblob from employeedetail where EmployeeID = '" + TextBoxEmployeeID.Text + "'", cn)
Dim image As Byte() = DirectCast(command.ExecuteScalar(), Byte())
stream.Write(image, 0, image.Length)
感谢您的帮助!
非常感谢您之前!这有助于我解决这个问题! :D再次感谢很多p3tch –