Trouble with attaching data into a database

I have just started using Visual Studio and I am trying to program an application to send information to a SQL database. I keep getting this error message and cannot figure out how to fix the problem:

System.Data.SqlClient.SqlException was unhandled
Class=20
ErrorCode=-2146232060
LineNumber=0
Message="An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

Could someone please help me fix this error?

Thank you,

Anthony Ostrem

[746 byte] By [AnthonyOstrem] at [2007-12-30]
# 1

Hi Anthony,

This Forum is dedicated to problems and solutions directly related to Developer Documentation and the Help Integration Systems relevant to the Visual Studio IDE.

Please try posting this query to the MSDN .Net Framework Data Access and Storage Forum located here:

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=45&SiteID=1

To help get you started, I did a Search based on the Error Code in your example snippet. David Schleifer of Microsoft has provided a solution in the thread shown below in that MSDN Forum:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=480390&SiteId=1

Check out David's second reply in the thread.

Hope this helps,

Frank

FrankPalinkas at 2007-9-5 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2

Anthony,

I think your Sql Server's Service is not running. Just go to Sql Server's Service manager and start the service. Now try to connect.

You can find some useful articles at,

http://chiragrdarji.wordpress.com/

http://chiragrdarji.blogspot.com/

Chirag darji
Team Lead

ChiragDarji at 2007-9-5 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified