0
Imこの質問について再度お詫び申し上げます... 私はこの質問を簡略化します。 これは私の問題です:タイプ 'System.DBNull'のオブジェクトをタイプして 'System.Byte []'と入力すると、MySQL Image
エラーポイントはあなたの助けのための
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)
おかげ
Dim image As Byte() = DirectCast(command.ExecuteScalar(), Byte())
コードです!
に割り当てる前に
DBNull
であれば、単純にチェック!これは私がこの問題を解決するのに役立ちます! :Dもう一度たくさんのp3tchに感謝 –