我使用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'ASPNETEXEC 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文件验证错误
发布评论