An unhandled exception of type 'System.NullReferenceException' occurred in sql.exe
Additional information: Object reference not set to an instance of an object.
Dim imageData As Byte() = DirectCast(cmd.ExecuteScalar(), Byte())
If Not imageData Is Nothing Then
Using m1 As New MemoryStream(imageData, 0, imageData.Length)
m1.Write(imageData, 0, imageData.Length)
PictureBox1.BackgroundImage = Image.FromStream(m1, True)
End Using
end if