Groups | Blog | Home
all groups > sql server (alternate) > august 2006 >

sql server (alternate) : 2005: cannot to connect from .NET


Erland Sommarskog
8/4/2006 10:01:26 PM
RAM (r_ahimsa_m@poczta.onet.pl) writes:
[quoted text, click to view]

Does the server accept connection from Named Pipes? Check this in
the SQL Server Configuration Manager.

Have you tried to connect over TCP/IP.

Also check firewalls etc.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
RAM
8/4/2006 10:03:24 PM
Hello,
Could you help me please to solve the prblem with connecting to SQL Server
from .NET development environment?
I have the following error:

"An error has occured 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 setting SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could nott open a connection to
SQL Server)

Please help. I changed option for remote connections but it doesn't help.
/RAM/

RAM
8/5/2006 12:00:00 AM
[quoted text, click to view]
Yes

[quoted text, click to view]
I am configuring data source. The message is displayed in Visual Web
Developer, the problem is not in source code.

Erland Sommarskog
8/5/2006 10:06:13 PM
RAM (r_ahimsa_m@poczta.onet.pl) writes:
[quoted text, click to view]

And client and server agree on the name of the pipe?

[quoted text, click to view]

Eh? Whether you configure a data source, have a program, or connect from
a tool like SSMS has nothing do with it. You can still set up the connection
to use TCP/IP. Usually TCP/IP is preferrable over named pipes.

Sorry, but I can't help more, because know next to nothing about your
machines. Are client and server on the same machine or different? Is the
instance a named instance or a default instance?

Did you check that the SQL Server Browser service is running and accepts
remote connections?

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
Erland Sommarskog
8/7/2006 1:27:07 PM
RAM (r_ahimsa_m@poczta.onet.pl) writes:
[quoted text, click to view]

SQL Server permits you to install several instances on the same machine.
One of these instances can be a default instances, all other instances
must be named.

When you refer to a default instance, you refer only to the machine name,
or, if you are on the machine itself, you can use ".", "localhost" or
"(local)" instead.

When you refer to a named instance, you must also include the instance
name separated from the machine name with a backslash, for instance
MYSERVER\MY2NDINSTANCE.

By default, SQL Server Express is installed as a named instance as
SQLEXPRESS, and thus "localhost" alone will not work on a machine that
only has SQL Express.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
RAM
8/7/2006 2:18:12 PM
I have noticed something interesting.
The problem occurs when I am configuring data source control. The connection
string is taken from web.config:
<add name="MIMMagazynDemo" connectionString="Data Source=localhost;Initial
Catalog=MIMMagazynDemo;Integrated Security=True"
providerName="System.Data.SqlClient" />

I have noticed that the problem do not exist when I change localhost to
PC\SQLEXPRESS (PC is name of my computer).

Could you explain me why? Thank you!

/RAM/



RAM
8/9/2006 12:00:00 AM
Thank you very much

Uzytkownik "Erland Sommarskog" <esquel@sommarskog.se> napisal w wiadomosci
news:Xns98189D268B5C9Yazorman@127.0.0.1...
[quoted text, click to view]

AddThis Social Bookmark Button