Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I want to apply password on my particular project's database, so no one can alter that except me!
How can i do that?
Posted

The SQL server architecture isn't (and neither other rdbms architecture is - except of maybe the embedded ones) made like this - because the authentication/authorization mechanism is more complex than that. I suggest you read trough this article: http://msdn.microsoft.com/en-us/library/bb669078.aspx[^]

[update]
First of all, if you make windows application, don't tag your question asp.net.
Second: if you want to hide database content completely, sql server is not the best approach. As I mentioned, administrator (local windows administrator also) is superuser in sql server. And using sql server might not be the best choice in such cases for other reasons too. Encrypted database is a feature from SQL Server Enterprise, and I am pretty sure you won't deploy this edition for a windows application. With SQL server express you have no real choices. With SQL CE you have. See: http://msdn.microsoft.com/en-us/library/gg592949.aspx[^], but be aware to keep the password safe - which is really hard if you have to install everything on the client computer.
You have other embedded database engines to choose from, which have built-in, or third party encryption, such as SQLite: http://sqlcipher.net/[^], http://www.sqlite-crypt.com/?gclid=CLrd242v5bcCFVMQtAod23YAmQ[^], http://www.sqlite-encrypt.com/[^]
 
Share this answer
 
v4
Comments
Gaurav Agarwal from Jaipur 14-Jun-13 6:20am    
didn't get it???
Gaurav Agarwal from Jaipur 14-Jun-13 6:23am    
Actually i have created a software and want to lock on that's database, so client or else can not alter that! Is it possible?
Zoltán Zörgő 14-Jun-13 15:27pm    
I get it. One thing is the database itself, and the other is the access to your application. Either way, the system administrator will have access to it. Please describe your scenario more detailed so we can give you more precise answers.
Gaurav Agarwal from Jaipur 15-Jun-13 0:44am    
Actually.. I m working on a windows application. When I give this software to the client it is necessary to give database also. I want to lock the database of sql server on his computer so that he cann't open that database or copy or view its schema or anything by which he can access that database. When he tries to access that, It must asks for a password. So, what is the solution for the above?
Zoltán Zörgő 15-Jun-13 1:53am    
Ok. That's an other thing. Please see my update.
See, for instance, this Stack Overflow's question: "Set password for SQL Server 2008 database"[^].
 
Share this answer
 
Comments
Gaurav Agarwal from Jaipur 14-Jun-13 6:20am    
Thanx but didn't get the solution!
You are talking about software and you have tagged question as ASP.NET.Tag it properly.

Further,i recommend you to use something like role management.E.g. There are two users Gaurav(admin) and rohan(user),then revoke access if rohan logs in,and allow only if gaurav logs in.Apply database related functionality only to admin,not to normal user.

Refer to below links which are very important as per as the role management is concerned.

Windows Forms:

A Secure Role-based Windows Form[^]

Controls Based Security in a Windows Forms Application[^]

Using the built in ASP.NET Role provider in Windows Forms or Console applications[^]

Web Application/Websites:

Understanding ASP.NET Roles and Membership - A Beginner's Tutorial[^]

Authenticate User by Roles in ASP.NET[^]

Understanding Role Management[^]

How To: Use Role Manager[^]


Regards..:laugh:
 
Share this answer
 

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