使用IIS从已发布的网站连接到数据库 [英] Connecting to Database from a published web site using IIS
本文介绍了使用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...
<connectionStrings>
<add connectionString="Data Source=(local)\SQLEXPRESS;Initial Catalog=ISSUserReigistration;Integrated Security=True" name="ISSUserReigistration"/>
</connectionStrings>
这是我在Web配置中用于连接字符串的代码.我正在使用sql2008 r2.它仅支持Windows身份验证.请帮助我完成此配置..
This is the code i have used in my web config for connection string. I m using sql2008 r2.it supports windows authentication only.help me what to do for this configuration..
推荐答案
将身份设置为具有数据库权限的Windows用户.
要知道如何设置身份,
检查一下.
http://technet.microsoft.com/en-us/library/cc771170%28v = ws.10%29.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/aa289855%28v = vs.71%29.aspx [ ^ ]
另请阅读
http://msdn.microsoft.com/en-us/library/bsz5788z.aspx [ ^ ]
Set identity as windows user who have permissions to database.
To know how to set identity,
check this.
http://technet.microsoft.com/en-us/library/cc771170%28v=ws.10%29.aspx[^]
http://msdn.microsoft.com/en-us/library/aa289855%28v=vs.71%29.aspx[^]
also read
http://msdn.microsoft.com/en-us/library/bsz5788z.aspx[^]
您还可以为您的网站创建一个sqlserver用户,并使用用户名和pass而不是使用集成安全性来指定连接字符串.
使用SQL Server登录名 [
You can also create a sqlserver user for your web site and specify the connection string using username and pass instead of using integrated security.
Working with SQL Server Logins[^]
我必须授予了在数据库属性中进行编辑的权限.它现在可以正常工作.
I jus gave permissions to edit in the database property.it s working fine now.
这篇关于使用IIS从已发布的网站连接到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文