Hello,
Can anyone tell me, how can i get Profile pictures of users which were uploaded by them during registration at run time from database?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Prabhu RajaPosted Oct 14, 2011, 1:29 AM
i have answered to thread about the same. You may try this.
http://www.c-sharpcorner.com/Forums/Thread/142043/how-to-save-and-retrive-image-fromto-picture-box.aspx
VikramPosted Oct 14, 2011, 12:32 AM
Here is template code :
DataTable dtDetail = new DataTable();
dtDetail = getProfileDetails(userID);
if (dtDetail.Rows.Count > 0)
{
if (dtDetail.Rows[0]["fieldname"].ToString().Length > 0)
{
//[ImageControlID].ImageUrl = "[Your Folder]/" + dtDetail.Rows[0]["fieldname"].ToString();
MemberIMG.ImageUrl = "Photo/" + dtDetail.Rows[0]["ipath"].ToString();
}
else
{
EMIPath.ImageUrl = "Images/image-not-found.gif";
}
}
This is how I achieve this functionality. I have created Image Name Unique and saved Image Name into database field instead of total path of Image.
Hope this will help you.
Shweta KuthiPosted Oct 14, 2011, 12:02 AM
VikramPosted Oct 13, 2011, 2:46 AM