I have developed a windows form application to run in desktop computers.
This is simple system written in c# which uses Microsoft access as its database.
I have almost completed the code and was going to create setup file for installation on other system.
I did create setup file and install in one of the system, but unfortunately the application is unable to find the database and throws me the following error.
I have put the database file in the root folder of the project.
I have provided the following connection string throughout the application.
In App.Config
configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="Database" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Database.accdb;Persist Security Info=False;"
providerName="System.Data.OleDb" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
In Application Classes
string connString = ConfigurationManager.ConnectionStrings["Database"].ConnectionString;
This is the first time i have created the setup file and i am not sure where i am wrong.
Can somebody find answer to my question?