It really depends on what kind of database you are using.
You say MDF files, which are normally SQL Server, and you shouldn't try to "create" them yourself, nor should you be involved in where they are stored - that is all up to SQL Server itself. If you do create them in a specific location, there is a very, very good chance that they won't work in production as Attaching a DB file to SQL only works on the localhost EXpress editions, and that isn't what you use outside development.
Instead, let SQL server take care of where it's stored by using the appropriate CREATE DATABASE SQL statement, followed by the CREATE TABLE and so forth:
SQL CREATE DATABASE Statement[
^]