Quote Originally Posted by Arjay View Post
Not sure why you've enabled named pipes - AFAIK, it's an older protocol that's not required any longer.

If you've attached the the database to your SQL Express instance, then you don't need to attach to the database by file name.

Instead, just select "Microsoft SQL Server" and press continue. Choose the machine and server instance (e.g. MYMACHINE\SqlExpress) and select the database.
I've tried disabling Named Pipes and the error message is still the same.

In relation to the rest of your advice, I think this is what I have done. I've right-clicked "Data Connections" in the "Database Explorer" panel in Visual C# 2008 Express and selected "Add Connection". This opens up a dialog window with the title "Add Connection".

Within this window are two text fields with the titles "Data source" and "Database file name (new or existing)". Within the first of these is the entry "Microsoft SQL Server Database File (SqlClient)". This is the only option I have to enter for this. Within the second text field I've then selected "AdventureWorksLT_Data.mdf". I then get the error when I click the "Test Connection" button.

Towards the bottom of the window is an "Advanced" button which opens up an "Advanced Properties" dialog. Is there some setting in there I can change to overcome the error?

Thanks