What im trying to do is, when user login then go to profile the system should check the username then get the picture that been uploaded by the user that have same index of his username. but i think that's not what happening.
Check how many elements you have in UserPic... because it seems you are trying to get the element 2, but USerPic has only one.
Anyway, there is something weird..."Name.Text" is the name of the username? you are trying to compare the username with an element from UserPic? and other wrong thing...you are trying to place the complete list UserPic into a Image.Picture (well, really on two).
what do you want to do with all those "compare texts" blocks?
"Index in list" gives you a number (the index of the element in the list) and you are comparing that number with the UserPic list? what do you want do do with that?
And when setting the images, you do the same ? Here I suppose you have to select an item from UserPic (the element with the same index of the user).
What i wanted to do here is to check if the picture of the same index of user have data, then if true then it would change the button on the user screen it would be "change profile button" instead of "upload profile button".
But it seems that I did something wrong in blocks, even when I try the "Do it" it didn't show me any error but intead it showing my that it's displaying the image.
It seems you have three paired lists...if a user has not picture , then what there is for that user in the UserPic list? an empty element? How do you know if the user has not a Picture?
I tried this and it work. Now my only problem is when user still didn't have saved photo in database it is showing an error message. and the change profile button how can I replace the existing picture in the system, like deleting the previous save then replace it with the current upload.
This is the error I'm getting:
Here's my block for change picture: Question: Do i need to save picture when i change the profile or this blocks would do the change in the database?
If you are going to handle three paired lists, you need have always the same number of elements in the three lists so, if any user doesn't enter the photo, you need to place a default value instead (you can use a default photo). Then, you can only replace the item if the user want to change it.
How can I do that? I mean save the default image as user create their account. like when user just create account then that would only time the default image would be save in db and display it on screen, then change it. or do I need to manually set the default value in the list?
I don't know how are you creating the three paired lists and storing them, but you need to have the same number of elements in the three lists to do this work.
You can have a "default.png" and if the user doesn't enter a photo, you can add it to the list.