Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. display image in GridView using image URL string "C:\images\abc.jpg"

display image in GridView using image URL string "C:\images\abc.jpg"

Scheduled Pinned Locked Moved ASP.NET
csharpdatabaseasp-nettutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mavii
    wrote on last edited by
    #1

    i am using ASP.net with C# and SQL Server2005i am using dataGrid view in an website, it has a an image column which is getting imageURL from a table in database. i want to display picture through URL of such format C:\images\abc.jpg but image i not being displayed, image is displayed ig i use "images/abc.jpg" can any one tell me how to display image using "C:\images\abc.jpg"

    S P 2 Replies Last reply
    0
    • M mavii

      i am using ASP.net with C# and SQL Server2005i am using dataGrid view in an website, it has a an image column which is getting imageURL from a table in database. i want to display picture through URL of such format C:\images\abc.jpg but image i not being displayed, image is displayed ig i use "images/abc.jpg" can any one tell me how to display image using "C:\images\abc.jpg"

      S Offline
      S Offline
      Saksida Bojan
      wrote on last edited by
      #2

      I don't think is possible. When executing from server, server have accsess only from Root of your specificied server. But here is a fact. when using \ in strings, it is intended to be special char example: \n - NewLine \t - tab \\ - Display \ you have to change. C:\\images\\abc.jpg

      1 Reply Last reply
      0
      • M mavii

        i am using ASP.net with C# and SQL Server2005i am using dataGrid view in an website, it has a an image column which is getting imageURL from a table in database. i want to display picture through URL of such format C:\images\abc.jpg but image i not being displayed, image is displayed ig i use "images/abc.jpg" can any one tell me how to display image using "C:\images\abc.jpg"

        P Offline
        P Offline
        Paras Kaneriya
        wrote on last edited by
        #3

        You need to use virtual path only you can not user physical path in ASP.Net applications I mean you can but it will then find the file to clients hard drive.

        Paras Kaneriya
        The difference between genius and stupidity is that genius has its limits.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups