Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
hello guys... I read some articles to deploy my web site on IIS 7 which I followed exactly I was told to. Now simple aspx pages are deployed successfuly but web applications that have database with it, are not deployed as expected.
For example, I have stored my user name and password in sql server but upon entering these in text box, the web page does not directs me to the next page, instead I am redirected to the same page. What is this problem and how can I solve it..?? thnx
Posted

You likely have the connection string for the database located in your web.config file.
Check and make sure that connection string works and that you can hit that database server from your web server. If that isn't the issue, you should have an exception of some kind being generated. Provide us information regarding this exception and we can help you further.
 
Share this answer
 
Comments
AmbiguousName 9-Mar-11 16:07pm    
NO..actually in the PageLoad() event of the LoginForm.aspx, I am creating new SqlConnection() with the connection string as argument. Then I retrieve the userID,Pass using SqlCommand(), do the comparisons and get redirected to next page. But this is in developent envirnoment using VS 2008. Now when I deploy same application. it does not do the required job.
fjdiewornncalwe 10-Mar-11 6:49am    
Sorry, I couldn't get back to you yesterday.
The point is from me is that the connection string itself that you are using in PageLoad() is probably not working. You can't connect to the database to get the user's specific username and such until you connect successfully and I suspect that this connection string is invalid. The difference may be that in your development environment your connection string is using your login credentials to gain access to the database which is ok. Once the application is deployed on a server, the application will run under a system account so the connection string credentials are now invalid for the given database, if you can even hit that from the server to start with.
Manfred Rudolf Bihy 9-Mar-11 16:48pm    
OP sounds sort of clueless. 5+
fjdiewornncalwe 10-Mar-11 6:50am    
In this case I get the impression that he is quite green to this so I'm putting on my "patient" hat and see where we go from here. Cheers and Thanks.
Manfred Rudolf Bihy 10-Mar-11 7:39am    
I think I'll have to go and grab one of those "patient hats" myself. Do you know a good source? :)
If you can't remotely debug your application on your IIS's server, maybe because of firewall restrictions, the second best would be to liberally sprinkle your code with logging statements. Since you seem to have problems with the DB stuff start inserting the first logging statements there. Remember that good exception handling is essential.
Maybe your DBMS isn't reachable from the server your IIS is running on. If you have remote access to the server with the IIS on it run this command from there: telnet DBMS.Server.name 1433 (if your SQL Server is listening on that port). If telnet is able to connect then a firewall is not an issue and you'll have to dig into your logfiles. If you are not yet using a logging framweork consider Log4Net[^].

Hope this gives you some ideas.
 
Share this answer
 
v3
Comments
AmbiguousName 10-Mar-11 3:30am    
well I am very new to ASP.NET. I am not bad with DB stuff. My IIS os on the same computer onwhich I am developing web site (I mean I am deploying web site on local IIS or localhost). Since I am very much new to it, thats why probably I am unable to explain the problem.
fjdiewornncalwe 10-Mar-11 6:53am    
This is exactly what my reply to you is based on. When deployed to IIS the application will not necessarily run under the same account as it will when you run it through Studio itself, so the database configured in your connection string (in your PageLoad method) is likely not able to hit the database. This is why the preferred way to deal with connection strings is to store them in the web.config file so that they can be changed and tinkered with without having to recompile the application each time.
fjdiewornncalwe 10-Mar-11 6:54am    
+5 for adding logging bit. I didn't offhand think of that this time. I use log4net in pretty much all my web applications and use the liberal logging to know what's going on as well. Cheers, Manfred.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900