Could not open a connection to SQL Server

Hi,

I have SQL Server 2000 installed in Windows 2003 Server. The Default instance was use for production server and i installed a new instance for developmet. SERVERNAME\DEVELOPMENT. My Problem is i cannot connectto Development Server. I am Using Visual Studio  2005 in developing Web Application and SQL Server is the database. Below is the error message when i access a page connecting to my database. My new instance is set to connection Mode Windows and Server Authentication.

ErrorMessage:

Server Error in '/apmconline' Application.
--------------------------------------------------------------------------------

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)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: 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 allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)



Thanks...


apmcphAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WiGgLrCommented:
Patch up SQL server 2000, there is a critical update needed.

Windows server 2003 disables the TCP/IP connections to SQL Server to protect against the slammer worm if you have an old mscordb.dll (I think that's the right one).

Here is the update you need:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&familyid=9552d43b-04eb-4af9-9e24-6cde4d933600

I spent all day on this a week or two ago!
0
WiGgLrCommented:
the exact file you need is linked on that page as SQLCritUpdPkg_ENU.exe
0
WiGgLrCommented:
hmm, re-reading what you posted I'm not sure I've actually posted the solution, rather the solution to a different problem (sorry about that).

could you post an example of your connection string please
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

imran_fastCommented:
<<(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)>>
Please in the computer managemnt ---> services and application --->microsoft sql server ---> connection protocols
check if named pipes and tcp id is enabled.
0
apmcphAuthor Commented:
Hi WiGgLr,

I'm just wondering why i can't connect to other instances except to the default instance.. But anyway, i will try to install the patch you give.

Here is my sample connection string in web.config

      <connectionStrings>
            <remove name="LocalSqlServer"/>
            <add name="LocalSqlServer" connectionString="server=WEBSRV\DEVELOPMENT;database=Users;integrated security=sspi;" />
            <add name="MasterConnectionString" connectionString="Data Source=WEBSRV\DEVELOPMENT;Initial Catalog=Master;user=sa;pwd=mypassword;" providerName="System.Data.SqlClient"/>
      </connectionStrings>


thanks
0
apmcphAuthor Commented:
Hi WiGgLr,

I installed the the critical update youve given but still no luck.. Pls take a note that the deafult instance is working properly. Only those other instances are not working..

thanks
0
imran_fastCommented:

<connectionStrings>
          <remove name="LocalSqlServer"/>
          <add name="LocalSqlServer" connectionString="server=WEBSRV\DEVELOPMENT;database=Users;Integrated Security=SSPI;" />
          <add name="MasterConnectionString" connectionString="Data Source=WEBSRV\DEVELOPMENT;Initial Catalog=Master;user=sa;pwd=mypassword;Persist Security Info=False;"Provider=SQLOLEDB.1"/>
     </connectionStrings>
0
imran_fastCommented:
Change your connection string to be as above.
0
apmcphAuthor Commented:
Hi imran_fast,

Can you explain whats the reason behind those changes? why do i need to change that?

0
imran_fastCommented:
to include Persist Security Info=False

When you use Persist Security Info=True it means, then all
security information, like UID and Password will be
available to you trhough connection string, after
connection has been established to database. In simple
words, if you esatblish connection to database then after
that your connection string will have information about
UID and Password of connected user. Prom security point of
view it means, then UID and Password are opened to others
and theoretically and practically others can get that
information from your connection string. If you use
Persist Security Info=False, it means , that after
connection established with database, your connection
string will remove security information from connection
string, and that information is not available to you and
others
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
imran_fastCommented:
Hi apmcph ,
Do you still need assistance.
0
apmcphAuthor Commented:
Hi  WiGgLr and imran_fast ,

Sorry for late reply.. But anyway i split the points for both of you. Actually WiGgLr was my accepted answer and imran_fast is the assisted answer. I dont know what happen when i split the points.

I gave WiGLr the 350 points and imran_fast gets the 150 points.

Why does WiGLr was the accepted answer, because when i install SQLCritUpdPkg_ENU.exe though it does not work immediately then it works later on without changing the connectionstring as imran_fast suggested. I give points to imran_fast because he gave time to explain his suggestion.

The thing i am frustrated is i dont see exactly what was the cause of the problem. Its just work.


thanks,
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.