Hi,
I am at a loss here, I have a c# asp.net website which connects to a
remote SQL Server 2000 db via a connection string. If I set the
website up in the filesystem and use the inbuilt cassini webserver in
VS2005 then everything is rosy. If I then set up the website on the
local IIS 5.1 the site no longer connects and returns this error:
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) Error Source: .Net SqlClient Data
Provider
Has anyone any idea why this might be and what could be happening
here? I can connect through Enterprise Manager. Here is the connection
string...
<connectionStri ngs>
<add name="MyConnect ionString" connectionStrin g="Data
Source=ServerNa me;Initial Catalog=MyDB;Tr usted_Connectio n=False;User
ID=user;Passwor d=password;" providerName="S qlNetTiersProvi der"/>
</connectionStrin gs
As you may have noticed, for a little extra confusion the site is
using a generated NetTiers layer. Like I said though, it all seems to
work for cassini.
Regards,
Oliver 5 7700
re:
!>Like I said though, it all seems to work for cassini.
On your *local* development box, which has SQL Server 2005, probably.
re:
!<connectionStr ings>
!<add name="MyConnect ionString" connectionStrin g="Data
!Source=ServerN ame;Initial Catalog=MyDB;Tr usted_Connectio n=False;User
!ID=user;Passwo rd=password;" providerName="S qlNetTiersProvi der"/>
!</connectionStrin gs
Why do you need a providerName if you're connecting to SQL Server 2000 ?
Have you tried connecting to the *remote* SQL server 2000 via IP ?
Here's an example connection string using an IP, instead of a server name :
Data Source=190.190. 190.190,1433;Ne twork Library=DBMSSOC N;Initial Catalog=theData Base;User
ID=Username;Pas sword=Password;
That would make your web.config entry look like this :
<connectionStri ngs>
<add name="MyConnect ionString" connectionStrin g="Data Source=190.190. 190.190,1433;
Network Library=DBMSSOC N;Initial Catalog=theDBNa me;User ID=Username;Pas sword=Password; "/>
</connectionStrin gs
1433 is the standard port used by SQL Server for remote accesses.
Substitute the real IP for 190.190.190.190 .
Try it...
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
"OJ" <of****@gmail.c omwrote in message
news:11******** **************@ l77g2000hsb.goo glegroups.com.. .
Hi,
I am at a loss here, I have a c# asp.net website which connects to a
remote SQL Server 2000 db via a connection string. If I set the
website up in the filesystem and use the inbuilt cassini webserver in
VS2005 then everything is rosy. If I then set up the website on the
local IIS 5.1 the site no longer connects and returns this error:
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) Error Source: .Net SqlClient Data
Provider
Has anyone any idea why this might be and what could be happening
here? I can connect through Enterprise Manager. Here is the connection
string...
<connectionStri ngs>
<add name="MyConnect ionString" connectionStrin g="Data
Source=ServerNa me;Initial Catalog=MyDB;Tr usted_Connectio n=False;User
ID=user;Passwor d=password;" providerName="S qlNetTiersProvi der"/>
</connectionStrin gs
As you may have noticed, for a little extra confusion the site is
using a generated NetTiers layer. Like I said though, it all seems to
work for cassini.
Regards,
Oliver
On 14 May, 15:00, "Juan T. Llibre" <nomailrepl...@ nowhere.comwrot e:
re:
!>Like I said though, it all seems to work for cassini.
On your *local* development box, which has SQL Server 2005, probably.
re:
!<connectionStr ings>
!<add name="MyConnect ionString" connectionStrin g="Data
!Source=ServerN ame;Initial Catalog=MyDB;Tr usted_Connectio n=False;User
!ID=user;Passwo rd=password;" providerName="S qlNetTiersProvi der"/>
!</connectionStrin gs
Why do you need a providerName if you're connecting to SQL Server 2000 ?
Have you tried connecting to the *remote* SQL server 2000 via IP ?
Here's an example connection string using an IP, instead of a server name :
Data Source=190.190. 190.190,1433;Ne twork Library=DBMSSOC N;Initial Catalog=theData Base;User
ID=Username;Pas sword=Password;
That would make your web.config entry look like this :
<connectionStri ngs>
<add name="MyConnect ionString" connectionStrin g="Data Source=190.190. 190.190,1433;
Network Library=DBMSSOC N;Initial Catalog=theDBNa me;User ID=Username;Pas sword=Password; "/>
</connectionStrin gs
1433 is the standard port used by SQL Server for remote accesses.
Substitute the real IP for 190.190.190.190 .
Try it...
Hi Juan,
thanks for the swift reply. I have altered the connection string which
now looks like this..(I also added the entry after it in the
web.config related to the nettiers provider). Now I get an error that
the host machine has actively refused the target regardless of whether
I run cassini or IIS.
<connectionStri ngs>
<add name="netTiersC onnectionString " connectionStrin g="Data
Source=172.x.x. x, 1433;Network Library=DBMSSOC N;Initial
Catalog=MyDB;Tr usted_Connectio n=False;User ID=user;Passwor d=password;"/
>
</connectionStrin gs>
<netTiersServic e defaultProvider ="SqlNetTiersPr ovider">
<providers>
<add name="SqlNetTie rsProvider"
type="BrandIQ.N etTiers.DAL.Sql Client.SqlNetTi ersProvider,
BrandIQ.NetTier s.DAL.SqlClient "
connectionStrin gName="netTiers ConnectionStrin g"
useStoredProced ure="true"
providerInvaria ntName="System. Data.SqlClient"
entityFactoryTy pe="BrandIQ.Net Tiers.Entities. EntityFactory"
enableEntityTra cking="true" enableMethodAut horization="fal se"/>
</providers>
</netTiersService >
Error:
(provider: TCP Provider, error: 0 - No connection could be made
because the target machine actively refused it.)
I have set up IIS to not use the IUSR account but instead to use my
Network logon details. I thought this might help but it didn't.
My local box does have SQL 2005 Express on it but I haven't used it
for anything yet. I am using the full version of VS2005.
Any more thoughts?
Thanks,
OJ
Here is my 2 cents. Just a guess here. You have security problem.
By default SQL using NetPipes protocol. The problem with NetPipes is that
it's using NT authentication inherently. Even if you using
"Trusted_Connec tion=False" the machine you are trying to connect to with
NetPipes will refuse connection if it does know account. Thus you got a
scenario when Casini works and IIS does not.
You need to
1. add to your connection string "Network Library=DBMSSOC N" to tell it to
use TCP/IP to connect.
2. Also keep "Trusted_Connec tion=false;" in the connection string.
3. Make sure TCP/IP connection is available on SQL server. Right click on a
server in SQL Manager, Tab "General", "Network configuration" button. Add
it if it's not available.
George.
"OJ" <of****@gmail.c omwrote in message
news:11******** **************@ e51g2000hsg.goo glegroups.com.. .
On 14 May, 15:00, "Juan T. Llibre" <nomailrepl...@ nowhere.comwrot e:
>re: !>Like I said though, it all seems to work for cassini.
On your *local* development box, which has SQL Server 2005, probably.
re: !<connectionSt rings> !<add name="MyConnect ionString" connectionStrin g="Data !Source=Server Name;Initial Catalog=MyDB;Tr usted_Connectio n=False;User !ID=user;Passw ord=password;" providerName="S qlNetTiersProvi der"/> !</connectionStrin gs
Why do you need a providerName if you're connecting to SQL Server 2000 ?
Have you tried connecting to the *remote* SQL server 2000 via IP ?
Here's an example connection string using an IP, instead of a server name :
Data Source=190.190. 190.190,1433;Ne twork Library=DBMSSOC N;Initial Catalog=theDat aBase;User ID=Username;Pa ssword=Password ;
That would make your web.config entry look like this :
<connectionStr ings> <add name="MyConnect ionString" connectionStrin g="Data Source=190.190 .190.190,1433; Network Library=DBMSSOC N;Initial Catalog=theDBNa me;User ID=Username;Pa ssword=Password ;"/> </connectionStrin gs
1433 is the standard port used by SQL Server for remote accesses. Substitute the real IP for 190.190.190.190 .
Try it...
Hi Juan,
thanks for the swift reply. I have altered the connection string which
now looks like this..(I also added the entry after it in the
web.config related to the nettiers provider). Now I get an error that
the host machine has actively refused the target regardless of whether
I run cassini or IIS.
<connectionStri ngs>
<add name="netTiersC onnectionString " connectionStrin g="Data
Source=172.x.x. x, 1433;Network Library=DBMSSOC N;Initial
Catalog=MyDB;Tr usted_Connectio n=False;User ID=user;Passwor d=password;"/
>>
</connectionStrin gs>
<netTiersServic e defaultProvider ="SqlNetTiersPr ovider">
<providers>
<add name="SqlNetTie rsProvider"
type="BrandIQ.N etTiers.DAL.Sql Client.SqlNetTi ersProvider,
BrandIQ.NetTier s.DAL.SqlClient "
connectionStrin gName="netTiers ConnectionStrin g"
useStoredProced ure="true"
providerInvaria ntName="System. Data.SqlClient"
entityFactoryTy pe="BrandIQ.Net Tiers.Entities. EntityFactory"
enableEntityTra cking="true" enableMethodAut horization="fal se"/>
</providers>
</netTiersService >
Error:
(provider: TCP Provider, error: 0 - No connection could be made
because the target machine actively refused it.)
I have set up IIS to not use the IUSR account but instead to use my
Network logon details. I thought this might help but it didn't.
My local box does have SQL 2005 Express on it but I haven't used it
for anything yet. I am using the full version of VS2005.
Any more thoughts?
Thanks,
OJ
On 14 May, 16:07, "George Ter-Saakov" <gt-...@cardone.com wrote:
Here is my 2 cents. Just a guess here. You have security problem.
By default SQL using NetPipes protocol. The problem with NetPipes is that
it's using NT authentication inherently. Even if you using
"Trusted_Connec tion=False" the machine you are trying to connect to with
NetPipes will refuse connection if it does know account. Thus you got a
scenario when Casini works and IIS does not.
You need to
1. add to your connection string "Network Library=DBMSSOC N" to tell it to
use TCP/IP to connect.
2. Also keep "Trusted_Connec tion=false;" in the connection string.
3. Make sure TCP/IP connection is available on SQL server. Right click on a
server in SQL Manager, Tab "General", "Network configuration" button. Add
it if it's not available.
George.
"OJ" <ofe...@gmail.c omwrote in message
news:11******** **************@ e51g2000hsg.goo glegroups.com.. .
On 14 May, 15:00, "Juan T. Llibre" <nomailrepl...@ nowhere.comwrot e:
re:
!>Like I said though, it all seems to work for cassini.
On your *local* development box, which has SQL Server 2005, probably.
re:
!<connectionStr ings>
!<add name="MyConnect ionString" connectionStrin g="Data
!Source=ServerN ame;Initial Catalog=MyDB;Tr usted_Connectio n=False;User
!ID=user;Passwo rd=password;" providerName="S qlNetTiersProvi der"/>
!</connectionStrin gs
Why do you need a providerName if you're connecting to SQL Server 2000 ?
Have you tried connecting to the *remote* SQL server 2000 via IP ?
Here's an example connection string using an IP, instead of a server name
:
Data Source=190.190. 190.190,1433;Ne twork Library=DBMSSOC N;Initial
Catalog=theData Base;User
ID=Username;Pas sword=Password;
That would make your web.config entry look like this :
<connectionStri ngs>
<add name="MyConnect ionString" connectionStrin g="Data
Source=190.190. 190.190,1433;
Network Library=DBMSSOC N;Initial Catalog=theDBNa me;User
ID=Username;Pas sword=Password; "/>
</connectionStrin gs
1433 is the standard port used by SQL Server for remote accesses.
Substitute the real IP for 190.190.190.190 .
Try it...
Hi Juan,
thanks for the swift reply. I have altered the connection string which
now looks like this..(I also added the entry after it in the
web.config related to the nettiers provider). Now I get an error that
the host machine has actively refused the target regardless of whether
I run cassini or IIS.
<connectionStri ngs>
<add name="netTiersC onnectionString " connectionStrin g="Data
Source=172.x.x. x, 1433;Network Library=DBMSSOC N;Initial
Catalog=MyDB;Tr usted_Connectio n=False;User ID=user;Passwor d=password;"/
</connectionStrin gs>
<netTiersServic e defaultProvider ="SqlNetTiersPr ovider">
<providers>
<add name="SqlNetTie rsProvider"
type="BrandIQ.N etTiers.DAL.Sql Client.SqlNetTi ersProvider,
BrandIQ.NetTier s.DAL.SqlClient "
connectionStrin gName="netTiers ConnectionStrin g"
useStoredProced ure="true"
providerInvaria ntName="System. Data.SqlClient"
entityFactoryTy pe="BrandIQ.Net Tiers.Entities. EntityFactory"
enableEntityTra cking="true" enableMethodAut horization="fal se"/>
</providers>
</netTiersService >
Error:
(provider: TCP Provider, error: 0 - No connection could be made
because the target machine actively refused it.)
I have set up IIS to not use the IUSR account but instead to use my
Network logon details. I thought this might help but it didn't.
My local box does have SQL 2005 Express on it but I haven't used it
for anything yet. I am using the full version of VS2005.
Any more thoughts?
Thanks,
OJ- Hide quoted text -
- Show quoted text -
Hi George,
that makes sense. That is what I first thought! When I connect over
TCP/IP the firewall is refusing the connection (even though SQL Server
is setup for TCP/IP ports), and even when I configure IIS to use my
network account (as cassini does), it is still getting refused through
NamedPipes for the reason you have just given.
Time to open some ports!
Thanks
OJ
re:
!Time to open some ports!
Indeed!
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
"OJ" <of****@gmail.c omwrote in message
news:11******** **************@ k79g2000hse.goo glegroups.com.. .
On 14 May, 16:07, "George Ter-Saakov" <gt-...@cardone.com wrote:
>Here is my 2 cents. Just a guess here. You have security problem.
By default SQL using NetPipes protocol. The problem with NetPipes is that it's using NT authentication inherently. Even if you using "Trusted_Conne ction=False" the machine you are trying to connect to with NetPipes will refuse connection if it does know account. Thus you got a scenario when Casini works and IIS does not.
You need to 1. add to your connection string "Network Library=DBMSSOC N" to tell it to use TCP/IP to connect. 2. Also keep "Trusted_Connec tion=false;" in the connection string. 3. Make sure TCP/IP connection is available on SQL server. Right click on a server in SQL Manager, Tab "General", "Network configuration" button. Add it if it's not available.
George.
"OJ" <ofe...@gmail.c omwrote in message
news:11******* *************** @e51g2000hsg.go oglegroups.com. ..
On 14 May, 15:00, "Juan T. Llibre" <nomailrepl...@ nowhere.comwrot e: re: !>Like I said though, it all seems to work for cassini.
>On your *local* development box, which has SQL Server 2005, probably.
>re: !<connectionSt rings> !<add name="MyConnect ionString" connectionStrin g="Data !Source=Server Name;Initial Catalog=MyDB;Tr usted_Connectio n=False;User !ID=user;Passw ord=password;" providerName="S qlNetTiersProvi der"/> !</connectionStrin gs
>Why do you need a providerName if you're connecting to SQL Server 2000 ?
>Have you tried connecting to the *remote* SQL server 2000 via IP ?
>Here's an example connection string using an IP, instead of a server name :
>Data Source=190.190. 190.190,1433;Ne twork Library=DBMSSOC N;Initial Catalog=theDat aBase;User ID=Username;Pa ssword=Password ;
>That would make your web.config entry look like this :
><connectionStr ings> <add name="MyConnect ionString" connectionStrin g="Data Source=190.190 .190.190,1433; Network Library=DBMSSOC N;Initial Catalog=theDBNa me;User ID=Username;Pa ssword=Password ;"/> </connectionStrin gs
>1433 is the standard port used by SQL Server for remote accesses. Substitute the real IP for 190.190.190.190 .
>Try it...
Hi Juan,
thanks for the swift reply. I have altered the connection string which
now looks like this..(I also added the entry after it in the
web.config related to the nettiers provider). Now I get an error that
the host machine has actively refused the target regardless of whether
I run cassini or IIS.
<connectionStri ngs>
<add name="netTiersC onnectionString " connectionStrin g="Data
Source=172.x.x. x, 1433;Network Library=DBMSSOC N;Initial
Catalog=MyDB;Tr usted_Connectio n=False;User ID=user;Passwor d=password;"/
</connectionStrin gs>
<netTiersServic e defaultProvider ="SqlNetTiersPr ovider">
<providers>
<add name="SqlNetTie rsProvider"
type="BrandIQ.N etTiers.DAL.Sql Client.SqlNetTi ersProvider,
BrandIQ.NetTier s.DAL.SqlClient "
connectionStrin gName="netTiers ConnectionStrin g"
useStoredProced ure="true"
providerInvaria ntName="System. Data.SqlClient"
entityFactoryTy pe="BrandIQ.Net Tiers.Entities. EntityFactory"
enableEntityTra cking="true" enableMethodAut horization="fal se"/>
</providers>
</netTiersService >
Error:
(provider: TCP Provider, error: 0 - No connection could be made
because the target machine actively refused it.)
I have set up IIS to not use the IUSR account but instead to use my
Network logon details. I thought this might help but it didn't.
My local box does have SQL 2005 Express on it but I haven't used it
for anything yet. I am using the full version of VS2005.
Any more thoughts?
Thanks,
OJ- Hide quoted text -
- Show quoted text -
Hi George,
that makes sense. That is what I first thought! When I connect over
TCP/IP the firewall is refusing the connection (even though SQL Server
is setup for TCP/IP ports), and even when I configure IIS to use my
network account (as cassini does), it is still getting refused through
NamedPipes for the reason you have just given.
Time to open some ports!
Thanks
OJ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Petr PALAS |
last post by:
Hi,
when I open ANY ASP.NET application on my computer I get this message:
----------------------------------------------------------------------------
----
Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web browser
|
by: Dave Dudley |
last post by:
Hi,
I have a new ASP .Net project that has been developed on our
development machine and connects to SQL Server 2000 on the same
machine. It is connecting via a connection string similiar to:
Data Source=;Initial Catalog=;uid=;Password=
|
by: EP |
last post by:
When running my asp.net hosting service (asp.net without IIS), on server
2003 with IIS not installed, I get the following when trying to process a
request.
"System.DllNotFoundException: Unable to load DLL (aspnet_isapi.dll)."
Of course the dll is able to be found, it's still in the framework directory
and for grins I even put it in my service's local directory. This is apparantly
server 2003 not allowing asp.net to be run if IIS was not...
|
by: Lorenzo |
last post by:
Hello,
I have a web application with a virtual directory in it. With 'virtual
directory' i mean
a folder whose physical path is different from the physical path of the
application, but in which Web Sharing is active.
For example:
my application is in "C:\Inetpub\wwwroot\MyApp",
the Virtual folder is in "C:\VirtualFolder",
and IIS sees it as if it were in "C:\Inetpub\wwwroot\MyApp\VirtualFolder".
|
by: Todd Brewer |
last post by:
Windows Server 2000
ASP.NET 2.0
SQL Server 2000 (on a physically seperate server)
I moved an ASP.NET 2.0 application from a development server to production,
and am getting the following error:
System.Data.SqlClient.SqlException: 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
| |
by: Jobs |
last post by:
Download the JAVA , .NET and SQL Server interview with answers
Download the JAVA , .NET and SQL Server interview sheet and rate
yourself. This will help you judge yourself are you really worth of
attending interviews. If you own a company best way to judge if the
candidate is worth of it.
http://www.questpond.com/InterviewRatingSheet.zip
|
by: Anbu |
last post by:
Hi All,
I'm using the Cassini component in my desktop application to create a
web site to host the web services. The application works fine in
normal scenario. If the system is kept idle for some time, the
application getting terminated with the following error:
Unhandled Exception : An existing connection was forcibly closed by
the remote host
at System.Net.Sockets.Socket.Send(Byte buffer, Int32 offset, Int32
|
by: Light |
last post by:
Hi all,
I posted this question in the sqlserver.newusers group but I am not getting
any response there so I am going to try it on the fine folks here:).
I inherited some legacy ASP codes in my office. The original code's backend
is using the SQL Server 2000 and I am testing to use it on the Express
edition.
And I run into the following problem.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |