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 –