Re: Cannot connect to database

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



It is not strange at all. It is very possible that you did not set up SQL Server (it seems that you use it, but you did not mention explicitly) and.or your ASP.NET application correctly. Points of interest:

1. Which user account your ASP.NET app is configured to use?
2. Does that account have permission to access the SQL Server/database?

When you do debugging run (press F5) on the develpment box, it is likely the ASP.NET app is run under your account, which is likely a local admin, hence no problem to access SQL Server.

"cashdeskmac" <cashdeskmac@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:D063BADE-E8CA-4CBA-A7B8-84DF169D0D44@xxxxxxxxxxxxxxxx
Hi,

Here’s my scenario. I have two machines:

DevBox
Windows 2000
IIS version 5

Desktop
WindowsXP Pro
IIS version 5.1

I open Visual Web Developer 2008 express on desktop and Select File>open
Website, and browse to a folder on DevBox. Once opened I run the project
using F5 and it does as it should (I click a button and it connects to a
database and displays information on a page).

The trouble starts when I open IE6 on desktop and type in
http://devbox/websitename/default.aspx. It finds the website and displays
exactly the same screen, but when I click the button it times out and throws
up an error message:

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)

The website uses AJAX controls, namely an UpdatePanel and Timer, and I
populate various controls in the code behind file. I have Microsoft ASP.NET
2.0 AJAX Extensions 1.0 installed on both machines.

It seems very strange that I can open the website using VWD 2008 and see it
working, but not if I browse to the website through IE6.

Can anyone suggest a possible cause?


.


Quantcast