4

I am developing a stand alone windows application in c# I am using service based database.

Can anyone tell me how to protect .mdf database from copying or attaching to sql server management studio without password from Client's machine ??

Is there any way to set Sql authentication for .mdf file ?

leppie
  • 115,091
  • 17
  • 196
  • 297
Muhammed Suhail
  • 269
  • 2
  • 6

3 Answers3

1

In the data folder any one can take database(.mdf file). And in import into their own sqlserver. We want to protect data. If some body take our database (.mdf file) then it can not import it into their own system.

0

No, is not possible.

If you want to prevent your users from using the database directly then you must host the database yourself, which implies making your application a Web service rather that a standalone Windows app.

Do not fall for various scams that pretend they offer a solution for this problem. Is all snake oil.

Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
0

just use SQL Server instead of SQL Express add your SQL database file to a installed SQL server Machine And Change Connection string to connect to it via SQL server then you can set password on your database in SQL server

Mamad
  • 446
  • 5
  • 22