How to fix: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path.
Posted by on 31 March 2011 06:21 PM
If you are receiving the following error:
System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
It means you are either trying to connect an mdf file to the SQL server or are in another way trying to create your own instance of SQL server. In a shared environment, it is not possible to do this. To use that database file, you will need to make a backup of it in a .bak format. Then, from your control panel:
1) Make a database: http://blog.arvixe.com/how-to-set-up-a-sql-2008-database/
<add name="ConnectionString1" connectionString="Data Source=localhost\sqlexpress;Initial Catalog=MyDB;Integrated Security=false;User ID=MyUserId;Password=MyPW" />
For the membership provider I'm using the same connection string:
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
What's strange is that I was able to use my User SignUp functionality to create a user and I can see that user in the Membership and the User tables but I STILL get this error whenever I try to login with this user.