Wednesday, March 21, 2012

Web service call from javascript and SQL Server 2005 Express

Hi,

I'm developing a web application that uses Ajax to call web services using javascript.

The web service must connect to a SQL Server 2005 Database (express edition) and uses a dynamically created connection. The connection string used to create the connection is right because it works for web page data loading and it uses SQL server authentication mode.

In the development environment the application works correctly, but when deployed on a different machine with a different SQL Server installation, the sql connection in the web service fails returning the following 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.

I've tried all suggested changes in SQL Server Configuration Manager andSQL Server Surface Area Configuration, enabling both tcp/ip and named pipes for remote connection, but the connection is still not working.

The server has a windows XP professional SP2 operating system and windows firewall is active, but i have enabled http from lan and sql server access.

Can you suggest me something?

I must add or change something in the web.config file?

I feel?that this problem is in the permissions connecting Web?Service?to?SQL?Server?2005.I give you some suggestions for your reference as the following:
Try to add Network Service in the virtual directory permissions of IIS and make sure the execute permissions is Scripts and Executables through?right mouse clicking the virtual directory?and?choosing?properties?in?IIS.

No comments:

Post a Comment