从IIS连接到数据库 [英] Connecting to Database from IIS

查看:312
本文介绍了从IIS连接到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在已经创建了一个虚拟目录,并在iis 6中托管了我的Web应用程序.在我的应用程序中,我正在使用登录页面.问题是它没有连接到数据库.我应该怎么做才能连接到sql 2008数据库.帮助我的朋友们...

I have jus now created a virtual directory and hosted my web application in iis 6. in my application i am using a login page,.the problem is it is not connecting to the database. what setting should i do to connect to the sql 2008 database.Help me friends...

推荐答案



在这里,您需要执行一些步骤来确定问题.

1)检查配置文件中的连接字符串是否正确.
2)检查您的数据库服务器是否可用.
3)在您的应用程序中添加日志记录以识别异常.

实际上,您的应用程序中会发生一些异常,但是您可能尚未创建日志记录,因此未获得确切的错误消息.

请在代码中添加记录,然后您将确定问题所在.

希望这些信息对您有帮助,

谢谢
-Amit Gajjar.
Hi,

Here you need to do steps to identify problem.

1) check if you connection string is correct in Config file.
2) check if your database server available.
3) add logging in your application to identify exception.

Actually some exception occur from your application but you may have not creating logging so not getting exact error message.

Please Add Logging in you code and then you will identify your issue.

Hope this information helps you,

Thanks
-Amit Gajjar.


检查应用程序池用户.如果使用集成安全性,则由池模拟的用户将尝试连接到数据库,因此需要具有所有必需的权限.您还需要从网络和防火墙的角度检查是否可以从Web服务器联系数据库服务器和服务.您收到的确切异常消息将帮助您识别问题-如果您将其添加到帖子中,我们也可以为您提供帮助.
Check application pool user. If you use integrated security, the user impersonated by the pool will try to connect to the database, thus needs to have all required rights. You also need to check if the database server and service can be contacted from the web server from network and firewall point of view. The exact exception message you get will help you in identifying the problem - and if you add it to your post, we also can help you in it.


这篇关于从IIS连接到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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