Cannot open user default database. Login failed.
Login failed for user
how to fix this error, I made a mistake and deleted the database or the mdf, how do you fix this?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
David SmithPosted Mar 15, 2010, 4:02 AM
Amit ChoudharyPosted Mar 15, 2010, 3:09 AM
<%--I made a mistake and deleted the database or the mdf, how do you fix this? --%>
i think this is your question.. you should have backup of your database. if you have then add that file to your app_data folder and then connect again. if don't have backup try any recovery tool. it not related to programming you have to back it up [mdf] file.
David SmithPosted Mar 15, 2010, 2:09 AM
Lalit MPosted Mar 15, 2010, 1:57 AM
http://benharrell.wordpress.com/2007/01/15/cannot-open-user-default-database-login-failed-login-failed-for-user-username-microsoft-sql-server-error-4064/
http://benharrell.wordpress.com/2007/06/18/update-cannot-open-user-default-database-login-failed-login-failed-for-user-%E2%80%98username%E2%80%99-microsoft-sql-server-error-4064/