Hi
I have an image converted to binay and saved in SQL database.
Below is my line of code where application is throwing above exception that im using for showing image

Dim mem As New IO.MemoryStream(CType(io.File.ReadAllBytes(imgfilepath), Byte()))

Does anybody knows how can i fix this?
Thanks and regards,
f

Hi

You can compare the Path Stored in DB with physical path of the file along with their file extension eg .bmp/.jpeg etc...

If the variable 'imgfilepath' has a invalid path or file name, it will throw
System.IO.DirectoryNotFoundException with error message 'Could not find a part of the path .......'.

Otherwise post the complete exception message. It will help to identity the exact issue.

Actually filename was incorrect .
Thanks Ramesh for pointing out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.