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.
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.
varun vimal sharanPosted Jun 2, 2013, 3:07 PM
Arun KurmiPosted May 27, 2013, 11:56 AM
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
Pankaj PandeyPosted May 27, 2013, 2:30 AM
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
Rohit KapdiPosted May 27, 2013, 1:01 AM
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.
Satyapriya NayakPosted May 26, 2013, 11:06 PM
Anurag SarkarPosted May 26, 2013, 4:49 PM
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