You may encounter this error while working with MS Sql Server Management Studio or using MS Sql in the code as data layer.
There are number of reasons because of which you might get this error, I'm listing few of them here, check if it applies to you.
* Ensure that you are connecting to sql using proper method (names pipes / shared memory )
* Check if you are able to ping the machine where sql server is installed from your development machine (where this error is coming), chances are that due to network problems (including loose cable connections) you might not be able to connect to the database!
A comment would be helpful incase this post solved your problem :)