Do not use the path you are now using for your database file. It is a location used to store your VS project in development. When you deploy your application, you should not use any of your development folders.
You should use a dedicated folder for your database, like
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
Or you can use the folder your app is installed in, provided that the every user has read/write access to it (it should not be e.g. in ProgramFiles
)
Try this one:
SQLiteConnection conn = new SQLiteConnection(
string.Format(
"data source={0}",
Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"db_SKMPayroll.sqlite"))
If you use a database file stored in your \bin\Debug
or \bin\Release
folder using CopyAllways, be prepared that your development database in \bin\
folders gets ovewriten with the database file from your project.