how to set startup path in app.config

alander

Well-known member
Joined
Jun 26, 2007
Messages
120
Location
Singapore
Programming Experience
5-10
In my app.config it is set that it will read Wages Application.mdb, however, when i open up a file dialog, the directory changes and my application cant find wages application.mdb anymore

I would like to fix it to Application.StartupPath\Wages Application.mdb, however this is xml and i don't know how to fix this

By the way i am using VBEE (click once deployment) so a setup project wouldnt help in my case.

any help will be appreciated

VB.NET:
    <connectionStrings>	
        <add name="Wages_Application.My.MySettings.Wages_ApplicationConnectionString"
            connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Wages Application.mdb"
            providerName="System.Data.OleDb" />
    </connectionStrings>
 
Last edited:
If you want to store the path in the app.config file you may store it in appSettings section and you may access it using the following code,

VB.NET:
System.Configuration.ConfigurationManager.AppSettings("YourPath")
 
Back
Top