Photo image not shown

yatie81

New member
Joined
Apr 24, 2009
Messages
3
Programming Experience
5-10
I have to call path for image from database.
I get the path. But problem here, the an image cannot be show on that page. Why?. Below is my
code.

Using adpPhotoPath As New dsPhotoTableAdapters.EmployeePhotoPathTableAdapter
adpPhotoPath.SelectCommand(0).CommandText = "Select * From EmployeePhotoPath"
Dim sWhere As String = "EmpNo = '" + lblEmpNo.Text + "'"
Dim dr As dsPhoto.EmployeePhotoPathRow = adpPhotoPath.GetDataByWhere(sWhere).Rows(0)
Dim drOrg As dsPhoto.EmployeePhotoPathRow = adpPhotoPath.GetDataByWhere(sWhere).Rows(0)


ImgPic.ImageUrl = GetValue(dr.Item("PhotoPath"), String.Empty)



End Using

Help me pls?
 
Image not show in a different path

For ur information my images path is a different path from my code.

I have to call path for image from database.
I get the path. But problem here, the an image cannot be show on that page. Why?. Below is my
code.

Using adpPhotoPath As New dsPhotoTableAdapters.EmployeePhotoPathTableAdapter
adpPhotoPath.SelectCommand(0).CommandText = "Select * From EmployeePhotoPath"
Dim sWhere As String = "EmpNo = '" + lblEmpNo.Text + "'"
Dim dr As dsPhoto.EmployeePhotoPathRow = adpPhotoPath.GetDataByWhere(sWhere).Rows(0)
Dim drOrg As dsPhoto.EmployeePhotoPathRow = adpPhotoPath.GetDataByWhere(sWhere).Rows(0)


ImgPic.ImageUrl = GetValue(dr.Item("PhotoPath"), String.Empty)



End Using

Help me pls?
 
Last edited:
Image

Do one thing execute your page.
Go to View menu > Souce > and check src (Source) of your Image.

and check file exists in that path.


Otherwise,

How are you saving image path in Database ???

Only use folderName/fileName into database and you will get the desired result.

:):):):):)
 
Do one thing execute your page.
Go to View menu > Souce > and check src (Source) of your Image.

and check file exists in that path.


Otherwise,

How are you saving image path in Database ???

Only use folderName/fileName into database and you will get the desired result.

:):):):):)


Dear Shemeer,
When i copied the path check whether The file exist in that path manually, the file is exist.

I saving in database like : D:\WINFLEX\PHOTOS\005625.jpg.
I get the path. But when i run it, image not show. Then i right click -->Properties-->the url get from C:\\Localhost.....
I think maybe because of different path and folder from coding. How to solve it if different path???
 

Similar threads

Back
Top