Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8828221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:33:24+00:00 2026-06-14T07:33:24+00:00

I am using VS 2010 for developing a web application. I am storing the

  • 0

I am using VS 2010 for developing a web application. I am storing the uploaded images in physical path of the Server and also created virtual path in IIS 7.5 (the screenshot below).In Authorization,one Warning is displayed.For using the belo code I try to retrieve the image from the server but the image is not display.Where the problem, in virtual path or in the path mention in code ?

IIS Error

    private void CallImage()
    {
     SqlConnection SqlCon = new SqlConnection(GetConnectionString());
     SqlCon.Open();
     string query = "SELECT Cmp_DocPath FROM Company_Info WHERE 
                          Vendor_ID= '" + ddlVendorID.SelectedValue + "'";
     SqlCommand SqlCmd = new SqlCommand(query, SqlCon);
     SqlDataAdapter da = new SqlDataAdapter(SqlCmd);
     DataTable dt = new DataTable();
     da.Fill(dt);
     string ImageName = Convert.ToString(dt.Rows[0][0].ToString());
     Image1.ImageUrl = this.ResolveUrl("D:/Upload/Commerical Certificates/"+ImageName);
    //  Image1.ImageUrl = this.ResolveUrl("D:\\Upload\\Commerical Certificates\\"+ImageName);
    //  Image1.ImageUrl = this.ResolveUrl("~\\Upload\\Commerical Certificates\\"+ImageName);
     SqlCon.Close();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:33:25+00:00Added an answer on June 14, 2026 at 7:33 am

    You can’t reference a physical location to an image and expect it to work on a Web site. Store the paths to the images as virtual paths from the root of the site. For instance:

    If your site root is at:

    d:\inetpub\mysite\
    

    And your images are at:

    d:\inetpub\mysite\uploads\images\
    

    Then your virtual paths int he database need to be:

    ~\uploads\images\image1.jpg
    ~\uploads\images\image2.jpg
    

    Then you can set that as the ImageUrl property and no, you don’t need to resolve it (the Image control does that automatically).

    My guess is that the reason you’re having this problem is because you are trying to reference images that are not within the Web site, which even if you get to work in your dev environment by giving access to NETWORK SERVICE, IIS_IUSRS, the second you move this application into a production environment, you are going to have problems. Not to mention that is a very poor way to do things in terms of security and modularity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are developing a REST based application using Visual Studio 2010, using asp.net web
I'm developing an Azure/MVC4 application using Visual Studio Web Developer 2010 Express, on a
I am developing an application using sharepoint 2010 server side object model. Can anyone
I'm developing an ASP.NET web application using Visual Studio 2010 professional and a SQL
I am developing an application in Delphi-2010 using SQL Server 2008 R2 in network
I'm developing a web application in visual studio 2010. I've a list view and
I am developing an MVC3 application using Visual Studio 2010. I have an aspx
I'm developing a web app using C# and MS VS 2010 IDE. The project
I am developing Windows Form Application using Microsoft Visual C# 2010 I have two
I am using sharepoint 2010 and developing a visual web part. I had javascript

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.