Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to display profile picture of employees when I select the Employee name from a list box. But for some employees there is no image available in the database. For such employees I want to display a default image. How can I do this? Please help me on this.
Thank You!
In your loading script you must be loading a mapping table for employee and the path\filename for employee picture. If so, you may add if condition in your load script to find if employee picture exists and load that, otherwise you can load a default image - image not available or something.
So briefly:
LOAD EmpName,
if(FileTime('c:\images\' & EmpName & '.jpg') > 0, 'c:\images\' & EmpName & '.jpg', 'c:\images\' & 'defualt.jpg') as EmpImage,
….
….
FROM ….
WHERE…
In your loading script you must be loading a mapping table for employee and the path\filename for employee picture. If so, you may add if condition in your load script to find if employee picture exists and load that, otherwise you can load a default image - image not available or something.
So briefly:
LOAD EmpName,
if(FileTime('c:\images\' & EmpName & '.jpg') > 0, 'c:\images\' & EmpName & '.jpg', 'c:\images\' & 'defualt.jpg') as EmpImage,
….
….
FROM ….
WHERE…
Thanks a lot Rakesh... It works fine 🙂