Link to home
Start Free TrialLog in
Avatar of rmitwiz
rmitwizFlag for United States of America

asked on

Web app access to the MS SQL Database works when debugging localhost but doesn't work once deployed to local IIS7 web server

I've created a web application in ASP.NET with VB.NET as the code-behind using Visual Studio 2010. The web application is connected to a MS SQL Server 2005 database on a remote web server on the company's intranet. When I run the application as localhost through Visual Studio 2010 everything works fine, I'm able to login to the website, and access data within the database from the website, as well as insert data in to the database via the web form.

The problem is once I deploy this web application to my local web server set up with IIS 7, and try to browse the site, the site comes up, but anything on the site related to accessing the MS SQL database (ex. inserting data through form, loginng in to access protected pages) is not functional. And the browser does not return any kind of error whatsoever.

Please help,
Thanks.
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

What are your security settings in the connectionstring to the database? Are you using SQL authentication or Windows authentication? http://www.connectionstrings.com/sql-server-2008

Are there database management tools e.g. SQL Server Management Studio on the web server - are you able to connect to the database from this server using SSMS?

Errors not showing on the interface might be due to how you are handling your exceptions. What are you doing with the exceptions in your Try...Catch blocks?
Avatar of rmitwiz

ASKER

My connection string is as follows:
<add name="ConnectionStringpforms" connectionString="Data Source=servername; Initial Catalog=DatabaseName; Integrated Security=True" providerName="System.Data.SqlClient" />

Yes, I am able to connect to the database from the server using SSMS.

And I do not have any Try...Catch Blocks in my code.
And keep in mind everything works perfectly  on localhost. Just not once the web application is deployed to my local machine's IIS7 web server.
ASKER CERTIFIED SOLUTION
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial