locked
how to upload image type RRS feed

  • Question

  • User1113074264 posted

    Hi ,

    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.

    Saturday, January 1, 2011 11:02 AM

Answers

  • User-2115483147 posted

    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. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 7, 2011 9:14 AM

All replies

  • User-723833757 posted

    image datatype store binary data, but you should reconsider using this datatype because it is being depricated

    http://msdn.microsoft.com/en-us/library/ms187993.aspx

    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.

    Saturday, January 1, 2011 4:04 PM
  • User1113074264 posted

    hi Bobby-z,

    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();




    Saturday, January 1, 2011 10:14 PM
  • User-2115483147 posted

    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. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 7, 2011 9:14 AM