It took me a few hours to piece together this valuable information online. Hopefully, I can spare you some headache. If you're using Microsoft SQL 2005 express and Visual Web Developer and are having trouble with steps 9-11 in the "Adding a GridView Control to Display Data" section above, follow these steps.
PART I: SET UP SQL SERVER EXPRESS
Click: Start/All Programs/Microsoft SQL Server 2005/Configuration Tools/SQL Server Surface Area Configuration.
Next to "Configure Local Area for localhost", click "Change Computer". Make sure "Local Computer" is selected and click OK
Click "Surface Area Configuration For Services and Connections".
You'll have basically three items in the left window, whose properties you can edit in the right window. Make sure you set the following options:
Database Engine/Service: "Startup Type" set to "Automatic". If "Service Status" does not indicate that it is "running", click "Start".
Database Engine/Remote Connections: choose "Using Named Pipes Only" or "Using both TCP/IP and named pipes"
SQL Server Browser/Service: "Startup Type" set to "Automatic". If "Service Status" does not indicate that it is "running", click "Start".
Now go back to Database Engine/Service and click "Stop" and then "Start" again so that your settings are incorporated (or restart your computer...)
PART II: MAKE SURE YOU HAVE THE NORTHWIND DATABASE
Follow the instructions at the top of this tutorial to install the Northwind database
PART III: CONNECTING TO THE NORTHWIND DATABASE
For steps 9-11 in the "Adding a GridView Control to Display Data" section above, substitute these steps:
1. For Server Name, type .\SQLEXPRESS (the period in front of the \
is vital). Click Test Connection to verify the status. It should return a
success message.
2. From Connect to a Database, click Attach a database, click Browse and point to
the C:\SQL Server 2000 Sample Databases folder.
3. From Select SQL Server Database Files, select NORTHWND.MDF
PART IV: SAY THANKS
If you found this helpful, please let me know. I spent 4 hours probably figuring this thing out and another 30 minutes typing the instructions above. A little recognition would be appreciated. Cheers and good luck.