Reputation: 53
I have created a Winforms app that writes all data to a SQL Server CE database. I am able to successfully install the app but when I try to read or write data, it tells me that it cannot open the connection. This only happens on PC's other than the one I created the program on. Nothing is hardcoded.
Does anyone have any suggestions?
Thank you
Upvotes: 1
Views: 171
Reputation: 81610
Windows will fight you with permission issues for locating the database in the Program Files directory. It doesn't belong there.
Consider moving the database to your own folder in this root folder:
Environment.SpecialFolder.ApplicationData
Obviously, the connection string needs to reflect that folder path.
Upvotes: 1