• 2.1k
  • 8
  • 10.7k

Problem With Saving Data To SQL Database After Installation

Nov 15 2010 2:30 AM

So I'm developing a program in Visual Studio 2010 that uses an SQL Database to save data from the program. I added a Visual Studio Installer to the project for a more professional installation, however I'm not really sure of the proper to add the databases to the installer. 

Here is the problem:

I can add the database's .mfd file and the database's log file (I can find both of these in the debug folder of the project file). However if I just add them to the installer it will install them to the program folder. The problem is that in Windows 7 all files within the programs folder are read only, so the program cannot edit the databases at all.

How can I install them to a different location and how do I make my program find the databases if they aren't in the same folder as the application (I have tried moving the database files, but my program won't find them unless they are in the same directory as the .exe file for my program)?

Any and all help is appreciated.

Answers (3)