If your MDF file was corrupt or in unrecognizable format then you have to use some third party tools to sql mdf repair it out for example like MDF Repair Kit or some others. You can search in Google.
http://www.mdf.repair/
But you can try to restore the file by yourself if it is not badly damaged.
Data from corrupt mdf file can be recovered by following method:
Repair MDF file with
DBCC CHECKDB:
Microsoft offers a command that is known as
DBCC CHECKDB, when you run this then it try to detect & fix all the possible error message. If it fails to fix error message then it suggest repair clause.
Re-run the command with suggest repair clause. Your problem might be solved. But, you may loss some amount of data after this.