---
title: "Server.MapPath in ASP.Net"  
description: "Server.MapPath in ASP.Net"  
author: "Mark Devid"  
published: 2014-08-25  
updated: 2014-08-25  
canonical: https://www.mindstick.com/forum/2132/server-mappath-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Server.MapPath in ASP.Net

I have developed a [Web Application](https://www.mindstick.com/articles/13069/progressive-web-application-pwas-all-you-need-to-know-about) using [ASP.Net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) with [Microsoft](https://www.mindstick.com/articles/12301/microsoft-is-trying-to-kill-passwords) Access as [database](https://www.mindstick.com/articles/12226/use-of-database-in-sencha-extjs-and-insert-record-from-user-form-using-ajax). Now i have [connected](https://www.mindstick.com/articles/12941/link-building-and-search-engine-rankings-how-are-they-connected) to the database using OleDB connection. The [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is when i give the database source in [Connection String](https://www.mindstick.com/articles/328/connection-strings) Source="C:/WebApp/DB/data.mdb". The connection throws an error stating the path is invalid and there is no such file.

I tried using

[Server.MapPath](https://www.mindstick.com/forum/34496/server-mappath-to-go-two-folder-back-from-root)("~/DB/data.mdb")

which gives the path as "C:/WebApp/DB/data.mdb" but throws the same error

Colud not locate file 'C:/WebApp/DB/data.mdb'

What should be the problem, even though if it works good in loalhost when i publish it to the server using Plesk, it shows the same error stating "C:/inetpub/xyx.com/httpdocs/..." not found

## Replies

### Reply by Sumit Kesarwani

Hi Mark, \

There might have several problems, would you please check below items:

Check the DB folder is exists at root level of your [application](https://www.mindstick.com/articles/12824/calculator-application-in-android)

Make sure the database file data.mdb is exist uder DB folder

Take appropriate action based on any option is missing as listed above.


---

Original Source: https://www.mindstick.com/forum/2132/server-mappath-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
