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 (r_ahimsa_m@.poczta.onet.pl) writes:
Quote:
Originally Posted by
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.
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/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Does the server accept connection from Named Pipes? Check this in
Quote:
Originally Posted by
the SQL Server Configuration Manager.
Yes
Quote:
Originally Posted by
Have you tried to connect over TCP/IP.
I am configuring data source. The message is displayed in Visual Web
Developer, the problem is not in source code.|||RAM (r_ahimsa_m@.poczta.onet.pl) writes:
Quote:
Originally Posted by
Quote:
Originally Posted by
>Does the server accept connection from Named Pipes? Check this in
>the SQL Server Configuration Manager.
>
Yes
And client and server agree on the name of the pipe?
Quote:
Originally Posted by
Quote:
Originally Posted by
>Have you tried to connect over TCP/IP.
>
I am configuring data source. The message is displayed in Visual Web
Developer, the problem is not in source code.
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/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||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 (r_ahimsa_m@.poczta.onet.pl) writes:
Quote:
Originally Posted by
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!
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/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thank you very much
Uzytkownik "Erland Sommarskog" <esquel@.sommarskog.senapisal w wiadomosci
news:Xns98189D268B5C9Yazorman@.127.0.0.1...
Quote:
Originally Posted by
RAM (r_ahimsa_m@.poczta.onet.pl) writes:
Quote:
Originally Posted by
>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!
>
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/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
No comments:
Post a Comment