Last post Jan 07, 2011 09:14 AM by Hong-Gang Chen - MSFT
Jan 01, 2011 11:02 AM|thenalimmu|LINK
In my database table i have coulmn with image data type.what should i put there? location of the image ? how do i retrieve the image later? as usual other data type?
Thanks in advance.
Jan 01, 2011 04:04 PM|Bobby-Z|LINK
image datatype store binary data, but you should reconsider using this datatype because it is being depricated
check out the replacement
I usually just use a nvarchar with a url to the image, and store the actual image in a folder on the site, storing images in binary in a database can really add up storage wise, and some hosting companies limit your db to 200mb or so.
Jan 01, 2011 10:14 PM|thenalimmu|LINK
Thanks for the reply.
image is uploaded to the database.how to retrive image to diplay ?this is my sqlcommand.i couldnt get the image?
timage.ImageUrl = myDataReader["Image"].ToString();
Jan 07, 2011 09:14 AM|Hong-Gang Chen - MSFT|LINK
I suggest you save the image path to database and mapping the path to image files, when you read images, just read the image path first, and then load the image files.