在IIS 7上部署期间无法访问数据库 [英] Database Not Accessible During Deployment on IIS 7

查看:103
本文介绍了在IIS 7上部署期间无法访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...我读了一些文章,将网站部署在IIS 7上,我完全被告知.现在,简单的aspx页面已成功部署,但是带有数据库的Web应用程序未按预期部署.
例如,我已经将用户名和密码存储在sql server中,但是在文本框中输入用户名和密码后,网页不会将我定向到下一页,而是将我重定向到同一页面.这是什么问题,我该如何解决..? thnx

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

推荐答案

您的web.config文件中可能具有数据库的连接字符串.
检查并确保连接字符串有效,并且可以从Web服务器访问该数据库服务器.如果这不是问题,则应生成某种异常.向我们提供有关此异常的信息,我们将为您提供进一步的帮助.
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.


如果由于防火墙的限制而无法在IIS的服务器上远程调试应用程序,则第二个最好的做法是使用日志记录语句自由地散布代码.由于您似乎对DB东西有问题,因此开始在此处插入第一个日志记录语句.请记住,良好的异常处理至关重要.
也许您运行IIS的服务器无法访问您的DBMS.如果您可以远程访问带有IIS的服务器,请从那里运行此命令:telnet DBMS.Server.name 1433(如果您的SQL Server正在该端口上侦听).如果telnet能够连接,则防火墙不是问题,您将不得不深入研究日志文件.如果您尚未使用日志记录框架,请考虑 Log4Net [
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.


这篇关于在IIS 7上部署期间无法访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆