hi friends,
I want to store an image in database and display on user account when user logined.like facebook or other....
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Anurag SarkarRank #1,049 · 1.8K reputationPosted May 26, 2013, 12:49 PM EDT
http://www.codeproject.com/Articles/9686/Save-An-Image-Into-SQL-Server-2000-Database
For checking which image is to be displayed for current user you should set image id for every user.You can check out these two links for help.
Thanks
Satyapriya NayakRank #47 · 31.5K reputationPosted May 26, 2013, 7:06 PM EDT
Rohit Kapdi19 reputationPosted May 26, 2013, 9:01 PM EDT
if u want to store the image in the database other then doing the conversion to byte and back from byte.
you can simply store the image name in the table name (i.e arun.jpg if the image name arun.jpg) and upload the image on server in a folder and when the that user logs in then u can directly give the link for the image in that folder.
Pankaj PandeyRank #642 · 3.7K reputationPosted May 26, 2013, 10:30 PM EDT
for your solution there is two ways.
first store image in a folder and save path of that image regarding that account to database.
second one convert image into binary and save it in database and when you are fetching info. regarding account also fetch binary data and convert it into image and show to profile pic.
first way is simple and second way is a little standerd way for you
i am giving a link which may help you.
http://www.c-sharpcorner.com/Blogs/11642/convert-image-into-a-binary-file-and-save-in-txt-file.aspx
mark as answered if helpfull
Arun Kurmi96 reputationPosted May 27, 2013, 7:56 AM EDT
but i have found all these reply with gridview.I just successfull to store image as
suppose these are my database then what to do....
table name:user_info
id: 101
name: arun
e_id: [email protected]
myphoto:
img_name:tulsi
varun vimal sharan18 reputationPosted Jun 2, 2013, 11:07 AM EDT