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.



Comments

Popular posts from this blog

530 Valid Hostname Is Expected When Setting Up IIS 10 For Multiple Sites

C Perror Example

Converting A String To Int In Groovy