Connection String To Connect To .MDF
Answer : If you're using the *.mdf file in the App_Data folder of an ASP.NET app you can use this. Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf;Database=dbname; Trusted_Connection=Yes; If it's not an ASP.NET application don't use the DataDirectory syntax and just use the full c:\... path.