SQL Server 2005 mdf file Query String

To add a SQL Server 2005 local database to one of your projects, create the connection as follows.

conn = new SqlConnection(@"server=(local)\SQLExpress; AttachDbFileName=|DataDirectory|MyDatabase.mdf; Integrated Security=false; User Instance=false");
conn.Open();
Author Barrington Haynes

I have nothing more to say

Add Comment

Name
Comment
 

Your comment has been received and will be shown once it passes moderation.