I have created a windows form application. I have included a local dabase named Z.mdf. In the app.config the connection string is like below:
<connectionStrings>
<add name="ZConnectionString"
connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Z.mdf;Integrated Security=false;Connect Timeout=30"
providerName="System.Data.SqlClient" />
</connectionStrings>
When I run the application from visual studio,it works fine. But when I deploy the application with advanced installer, it gives the following error:
Cannot open database "C:\PROGRAM FILES\X\Y\Z.MDF" requested by the login. The login failed. Login failed for user 'DESKTOP-xxxxx''
How can I resolve this problem?