WhiteStar1 WhiteStar1 - 2 years ago 479
Vb.net Question

How to check a image byte array is empty in VB.Net?

Hello I need to check if a photo is empty. It's define as Byte(). IDE throwing error when I do this - If Photo.Length = 0 then. I really need your help. Thanks.

Answer Source

Perhaps you need to perform a null check on the array before you attempt to access any properties. You'll need to post more code if you want better help.

If Photo IsNot Nothing AndAlso Photo.Length > 0 Then
    'Photo isn't empty
End If  
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download