I think your question is not entirely clear. This post may help though: http://stackoverflow.com/questions/8926512/how-do-i-connect-to-an-mdf-database-file