转载自:
http://publishblog.blogchina.com/blog/tb.b?diaryID=336088解决方案:
osql -S
COMPUTERNAME\VSDOTNET -E
USE
DATABASENAME EXEC sp_grantlogin '
COMPUTERNAME\ASPNET'
EXEC sp_grantdbaccess '
COMPUTERNAME\ASPNET'
EXEC sp_addrolemember 'db_owner', '
COMPUTERNAME\ASPNET'
go
原因:
The basic problem is that your SQL Server/MSDE database does not recognize the account name of the process running the Web page. ASP.NET applications run within the context of an account named
computer\ASPNET. When your code runs, it makes a request to the SQL Server/MSDE for a trusted connection as the user
computer\ASPNET. SQL Server/MSDE probably doesn't know who that is, so it refuses the connection.