I faced that problem when i run my application from localhost. Got the solution
Go to command prompt and write these commands. Take care of the spelling database name and tablename.
cd C:Program FilesMicrosoft SQL Server80ToolsBinn
osql -E -S localhost -Q “sp_grantlogin ‘MYCOMPUTERASPNET’”
osql -E -S localhost -d DatabaseName -Q “sp_grantdbaccess ‘MYCOMPUTERASPNET’”
osql -E -S localhost -d DatabaseName -Q “sp_addrolemember ‘db_owner’, ‘MYCOMPUTERASPNET’”
–Don’t forget to change you computer name and database name


Thanks – I know I figured out this solution a couple of years ago but never wrote it down … and I needed it again
[...] failed for user MachinenameASPNET http://ashrafur.wordpress.com/2007/09/23/login-failed-for-user-machinenameaspnet/ Explore posts in the same categories: [...]