0

I have been working on a project in vb.net which uses an SQLite database (Patient_Database.db). The connection between the software and the database works when I debug the program, and the database is stored in the project folder, and automatically transferred to the debug folder, as shown:

Database in solution explorer

Database in debug folder

However, when I publish the project in order to make an executable, the database is not included in the publication. I have spent all day trying various walkthroughs online but I just don't seem to be able to get the publication to include the database or the necessary SQLite.Interop.dll file in the x64 and x86 folders in the Debug folder.

My published project looks like this:

Publication

With the following inside the Application Files folder:

enter image description here

I realise that I might be doing something stupid, or that I might just be going about this in the entirely incorrect way. If anyone could correct my flawed methods that would be very helpful!

Thanks

4
  • Possible duplicate of How to publish my windows form application with database Commented Jul 3, 2016 at 20:40
  • The selected answer for that question says: "You will need to deploy your database as "IncludeData" in the application settings." However after trying for the past 15 minutes or so I don't seem to be able to locate an application settings or an IncludeData setting. Commented Jul 3, 2016 at 20:56
  • Go to the Publish tab and click the Application Files button. Commented Jul 4, 2016 at 0:56
  • Hi. I thought this might be the answer, and I have tried it. However, the database is not listed; even when I press "show all files" Commented Jul 4, 2016 at 20:16

2 Answers 2

2

In regards to the comments some visual help for you:

Add DB to published files 1

  1. Open project properties of your main project
  2. Select the Publish tab
  3. Choose Application files...

Add DB to published files 2

  1. Find your db file
  2. If it is not listed, select Show all files first
  3. Set the Publish Status to Include
  4. The Download Group should be Required.

After a new publish the DB file should be contained in the Application Files on your server.

EDIT: To make the file visible for the published application files you have to set its 'Build Action':

Make DB file available for publish

Sign up to request clarification or add additional context in comments.

2 Comments

Hi. I thought this might be the answer, and I have tried it. However, the database is not listed; even when I press "show all files"
great visual demo but this is the only step that you need: i.e., Right click the db file in solution explorer then set its Build Action to CONTENT as demonstrated here i.sstatic.net/nfCP9.png.
-1

enter image description here Just add a folder "Database" in your project and insert there your file.db

Then on Publish "Application files" include as dataFile your file.db

enter image description here

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.