Web.config文件验证错误 [英] Web.config Authentication Error

查看:122
本文介绍了Web.config文件验证错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SQLServer2005的和VS2008。在web.config中我的连接字符串是:

I am using SQLServer2005 and VS2008. My connection string in web.config is:

add name="library" connectionString="Data source=KMT; Initial Catalog=Library;Integrated Security=SSPI"

下面,国民党是我的服务器的名称,图书馆是我的数据库。

Here, KMT is my server name, Library is my database.

当我通过VS2008本地主机上运行我的网页,它的罚款。但是,查看通过IIS当它显示像用户登录失败,国共/ ASP.NET'的错误消息。我的SQLSERVER身份验证模式是Windows和它在web.config中确定。会有什么解决办法吗?

When I run my page through VS2008 localhost, it's fine. However, when viewing through IIS it shows an error message like "login failed for user, 'KMT/ASP.NET'". My sqlserver authentication mode is windows and it's ok in web.config. What will be the solution?

推荐答案

我的一个朋友帮我解决这个问题,
我执行的SQL添加ASPNET作为登录到
我的数据库和设置权限DA

one of my friends helped me to solve this problem as i executed the SQL to add ASPNET as a login to my DB and setup DA permissions

EXEC sp_grantlogin才N'MACHINE \\ ASPNET'
EXEC sp_defaultdb N'MACHINE \\ ASPNET',N'Database
利用数据库
EXEC sp_grantdbaccess N'MACHINE \\ ASPNET',N'ASPNET
EXEC sp_addrolemember N'db_owner',N'ASPNET

exec sp_grantlogin N'MACHINE\ASPNET' exec sp_defaultdb N'MACHINE\ASPNET', N'Database' use Database exec sp_grantdbaccess N'MACHINE\ASPNET', N'ASPNET' exec sp_addrolemember N'db_owner', N'ASPNET'

这里Machine是计算机名和数据库是我的数据库名。
但通过这个ASPNET用户拥有总
在该数据库的控制。

here MACHINE is machine name and database is my database name. but through this the ASPNET user has total control over that DB.

这篇关于Web.config文件验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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