Creating a relative path to a Database in Asp.net for a library

Posted by Greener on Stack Overflow See other posts from Stack Overflow or by Greener
Published on 2012-03-21T23:27:41Z Indexed on 2012/03/21 23:29 UTC
Read the original article Hit count: 130

Filed under:
|
|
|
|

In school I am part of a team of four working to create a GUI to translate the paper records of a made-up company and their functionality to a digital format. We're using an ASP.NET website for this purpose.

Basically we use stored procedures and C# classes to represent the database. The folder we're using for the project contains the site and the libraries in separate folders. If I try to open the site from the folder containing both these elements the site will not run. I want to know if there is some way I can set up a relative path to the database in the Settings.Settings.cs file (or by some other means) of my libraries so I don't have to constantly change the database location for the connection string value every time we move the project.

I suppose I should also mention that the database is in an App_Data folder.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET