0

I have recently written a C# program whose functionality is to create and populate three tables in a SQLite database with ten thousand randomly-generated dummy entries at the click of a button. When I sent it to my partner over Skype and they executed the file on their computer, the application begins populating entries for awhile before returning the error in the title of this post. It appears at the bottom of my UI and created by a BackgroundWorker object which performs the actual database creation and population, invoked with a single button click.

my partner's code returns the error

I developed the application using VisualStudio and used PetaPoco methods to perform the insertions. When I build and run the program from VisualStudio, it works just fine, as the image below shows. The same is true if I compress the bin/debug files into a zip folder, extract them to a different directory on my PC, and run the executable file just as my partner who received the readonly error did.

successful execution on my side

My problem is similar to this one; however, there is no answer in that post which is over a year old now. I am suspecting that it could be related to user permissions. Is this so, and is there any way to modify the program on my side such that my partner will not receive the error when they run my code?

Andrew Lau
  • 145
  • 12
  • Have you checked this https://stackoverflow.com/questions/1518729/change-sqlite-database-mode-to-read-write and this https://stackoverflow.com/questions/31819783/sqlite-attempt-to-write-a-readonly-database-error/31821594 ? They might be helpful. – Christos Jan 19 '18 at 20:38
  • The second post is indeed the kind of situation I am in but as @UWSkeletor's comment states, "The application successfully writes to the database. It is only on random iterations that it gets this error." – Andrew Lau Jan 19 '18 at 20:48

1 Answers1

1

this is funny but i think solved just right click on db file and properties and activate readonly ! i mean it must be checked

Lekhaym P
  • 11
  • 2