Click here to Skip to main content
Rate this: bad
good
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 21: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 at 21-Sep-12 4:34am
   
Thank you Mehdi Gholam. Its working fine.
Mehdi Gholam at 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
0 Zoltán Zörgő 320
1 CHill60 165
2 BillWoodruff 120
3 Peter Leow 120
4 bling 80
0 Sergey Alexandrovich Kryukov 9,423
1 OriginalGriff 6,891
2 Peter Leow 4,637
3 Zoltán Zörgő 4,304
4 CHill60 2,932


Advertise | Privacy | Mobile
Web01 | 2.8.150129.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2015
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