Click here to Skip to main content
15,941,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used the sql compact edition [.sdf file] as my database, and i installed the application in another system, but the access to the db file is denied, how can i set the access in the connection string ?
Updated 7-Jan-20 2:51am
Mukesh Pr@sad 7-Nov-14 6:52am    
go through the following link

1 solution

It may not be your connection string: it may well be where you deployed the file to.
If you put it in the application folder, then it will owrk fine on your development system, but it will fail in production because normal users don't have write access to folders under the Program Files directory for security reasons.
Have a look at this: Where should I store my data?[^] - it suggests some better options.
Share this answer
Midhun Thadathil 7-Nov-14 7:15am    
Thank you ! i did put the .sdf file in the Application Folder. is there no other way to access that file.
OriginalGriff 7-Nov-14 7:28am    
Not without elevating your application and invoking UAC each time you want to use it! :laugh:
Seriously, put it in a "safe" folder: application related folders are becoming harder to use, not easier. It's not difficult at all to use the "proper" locations.
Midhun Thadathil 8-Nov-14 6:42am    
Thank You. I will try it.
OriginalGriff 8-Nov-14 6:49am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900