Re: Error while connecting to SQL 2005 from ASP.Net 2.0

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello,

Win XP with SP2 may have Windows Firewall blocking you. Check this
link out for more info:

http://support.microsoft.com/default.aspx?scid=kb;en-us;839269





On Feb 21, 9:01 pm, stch...@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
wrote:
Hello Sriram,

According to theerrormessage/callstack you attached, the direct exception
is a "SoapException", so I think your ASP.NET web application is calling
another ASP.NET webservice webmethod, correct?

As the SoapException's innererrormessage show the followingerror:

=========
System.Data.SqlClient.SqlException: Anerrorhas occurred while
establishing a connection to theserver. When connecting toSQLServer
2005,
this failure may be caused by the fact that under the default settingsSQLServerdoes not allow remote connections.
=============

I think the root cause of the problem is the data accessing from the
ASP.NET webservice to theSQLServer2005 box. Is the webservice
application on the same machine as your ASP.NET web application and theSQLServeron a remoteserver? If so, as theerrormessage indicate, theSQLServer2005 currently disallow remote connection to it. ForSQLserver
2005 (express or developer edition), by default, it only enable remote
connection for TCP/IP protocol, and TCP/IP is not enabled by default. I
suggest you use "SQLServerConfiguration Manager" to check theserver
protocols and ensure that bothnamedpipe and TCP/IP are enabled. And use
the "SQLServerSurface Area Configuration" tool to configure theSQLServerinstance to allow remote connection (at least for TCP/IP connection).

Here is a knowledge base article discussing on this:

#How to configureSQLServer2005 to allow remote connectionshttp://support.microsoft.com/kb/914277/en-us

If you have anything unclear on this or if the problem here has other
particular symptoms, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer tohttp://msdn.microsoft.com/subscriptions/managednewsgroups/default.asp...
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) athttp://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


.



Relevant Pages

  • Re: Transaction Error on None-Transaction Query
    ... Create database connection ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: DataTable.Load()
    ... connection opening each time, as the Reader is a firehose cursor. ... as the entire Load() operation should normally be in milliseconds. ... suggestions about how we can improve the support we provide to you. ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: format of the initialization string does not conform to specification starting at index 0
    ... instead of being able to browse to the location of the Access Database File ... When I tried to enter the connection string manually, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.general)
  • RE: remote database connection in asp.net program
    ... it is a common connection error ... How to configure SQL Server 2005 to allow remote connections ... Microsoft Online Community Support ... nature are best handled working with a dedicated Microsoft Support Engineer ...
    (microsoft.public.sqlserver.connect)
  • Re: Cannot connect a remote sql server
    ... Generally for SQL Server connecting issue, ... such as the server's firewall, SQL Server's remote connection setting, ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.adonet)