Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot connect server(local)

Status
Not open for further replies.

neomax

Programmer
Jul 1, 2006
29
BG
Hi,

it so strange problem!! I create new databases and tables, managing them from MS VisuaL Studio and SQL server interface tool, but can't use them when call to it from application.
On conn.Open() the compiler show an exception
"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)"

At ERRORLOG file:

2006-08-27 16:39:03.64 Server Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86)
Apr 14 2006 01:12:25
Copyright © 1988-2005 Microsoft Corporation
Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

2006-08-27 16:39:03.74 Server Error: 17054, Severity: 16, State: 1.
2006-08-27 16:39:03.74 Server The current event was not reported to the Windows Events log. Operating system error = 1502(error not found). You may need to clear the Windows Events log if it is full.
2006-08-27 16:39:03.76 Server © 2005 Microsoft Corporation.
2006-08-27 16:39:03.76 Server All rights reserved.
2006-08-27 16:39:03.76 Server Server process ID is 1872.
2006-08-27 16:39:03.76 Server Logging SQL Server messages in file 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2006-08-27 16:39:03.78 Server This instance of SQL Server last reported using a process ID of 1872 at 27.8.2006 ?. 13:25:38 (local) 27.8.2006 ?. 10:25:38 (UTC). This is an informational message only; no user action is required.
2006-08-27 16:39:03.78 Server Registry startup parameters:
2006-08-27 16:39:03.82 Server -d c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2006-08-27 16:39:03.82 Server -e c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2006-08-27 16:39:03.82 Server -l c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf


Please, give me your prof opinion what I have to do?


 
Make sure tcp/ip is enabled for SQL Server. Then, go to and compare your connection string (within the app) to the appropriate connection string at the web site.



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
thanks gmmastros ,
but I find the solution!!

new SqlConnection("server=localhost,PORT; database=web1.dbo; trusted_connection=yes;");

PORT- port for your server( in my case I use port for TCP\IP)

thanks))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top