Click here to Skip to main content
12,254,393 members (67,620 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: WPF
Dear Experts,

I've a application, in which I'm connecting to sdf db file. If i install my application in "C:\Program File" my application is not able to connect to database. Its giving error that failing to connect to database. But if i install same application in some other drive e.g. D or E, then its able to connect to DB.

How can i grant access in C:\Program file in windows 7?

Thank you all.

Regards,
Vidi
Posted 20-Sep-12 20:36pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

"Program Files" is protected by Windows. You have to use another folder for saving your data, read here : http://stackoverflow.com/questions/867485/c-sharp-getting-the-path-of-appdata[^]
  Permalink  
Comments
vidiking 21-Sep-12 4:34am
   
Thank you Mehdi Gholam. Its working fine.
Mehdi Gholam 21-Sep-12 4:40am
   
Great!

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100