Click here to Skip to main content
15,908,274 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi friends
i created a setup project in c# vs2010 for my project and build it.After install the application in destination system, database files(db.mdf and db.ldf) is next to the exe file in destination folder! and any users will be able to delete or move them so it is not good!!
How to solve this problem?can i create setup project which is contain just one file and not show database files after installing?
i want to hide database files from users in destination folder.
Posted
Updated 2-Apr-13 17:47pm
v3
Comments
sahabiswarup 28-Nov-12 1:05am    
Have to added that database file in Application Folder while building the setup file?
FM7 3-Apr-13 0:50am    
yes,put them in Application folder,but it is clearly in reach of users after install(user can delete them!!)

1 solution

Installing the database on user's machine and not allowing him the access is a bad idea. If it is installed on his machine, then he has full rights to do whatever he wants. Because , the machine, the OS , the disk space and the application belongs to him..

So, Let the user decide what he has to do with the database files. You have no right to force him..

1. He may need the access to backup the database or to move it to another drive to get space. What should he do if the database size increases to 100 GB and he runs out of space on C drive ..?? Format his computer ???

2. He will need access to remove old data onto a separate backup server if it grows too big.

3. He may want to create indexes and other database maintainace tasks.

OR

The best way...
Install the database on your machine and let the application access it remotely...
 
Share this answer
 
Comments
FM7 3-Apr-13 1:46am    
Ok.Good.
Now anotehr question is: in case of Uninstall the application and install it again,all of data in DB will lost!!!because DB in first time has been empty.can you help please?
bbirajdar 3-Apr-13 4:57am    
Yes.. Follow the best way mentioned above
FM7 3-Apr-13 6:27am    
Excuse me,losing all data in DB is not good!! is there a way to keep data in DB after uninstall and install again?
bbirajdar 3-Apr-13 6:57am    
Yes.. The best way mentioned above ..i.e. to install the database on your machine and let the application access it remotely... You will have all sort of problems if you decide to install the database on user's machine.. These are a few of them

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