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 ?
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.