Run-time errors can occur because you do not have sufficient permissions to access the databases used in these walkthroughs. See the following steps to help resolve the most common of these issues.
Log-On Issues
Your application might be trying to access the database by way of a database logon it does not accept.
To verify or change the database log on
On the Windows Start menu, point to All Programs, Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Configuration Manager.
In the left pane of the SQL Server Configuration Manager, click SQL Server 2005 Services.
In the right pane, right-click SQL Server (SQLEXPRESS), and then click Properties.
Click the Log On tab and verify how you are trying to log on to the server.
In most cases, Local System works.
If you make a change, click Restart to restart the service.
Protocols
At times, protocols might not be set correctly for your application to access the database. For example, the Named Pipes protocol, which is required for walkthroughs in LINQ to SQL, is not enabled by default.
To enable the Named Pipes protocol
In the left pane of the SQL Server Configuration Manager, expand SQL Server 2005 Network Configuration, and then click Protocols for SQLEXPRESS.
In the right pane, make sure that the Named Pipes protocol is enabled. If it is not, right-click Name Pipes and then click Enable.
You will have to stop and restart the service. Follow the steps in the next block.
Stopping and Restarting the Service
You must stop and restart services before your changes can take effect.
To stop and restart the service
In the left pane of the SQL Server Configuration Manager, click SQL Server 2005 Services.
In the right pane, right-click SQL Server (SQLEXPRESS), and then click Stop.
Right-click SQL Server (SQLEXPRESS), and then click Restart.