Failed to generate a user instance of SQL Server
I been trying to get my Visual Studio 2008 to run my Web Application on IIS7 on my Windows 7 machine but I just can't get it to work. I'm using the SQLEXPRESS I been following this Tutorial, but I get the following error message.
"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."
my connectionString seem to be ok
<add name="testConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|test.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
The site run with out database connection.
Any ideas and thoughts about 开发者_StackOverflow社区this?
Thanks guys
Make sure the instance name is called "SQLEXPRESS" exactly.
Make sure the "test.mdf" file exists in the "App_Data" folder.
When you are adding the DB using Server Explorer, use "Test Connection" first.
In IIS7, they use default asp.net database.
create a new application pool instead of using default. and keep your database in that.
go to sql configuration manager and in the properties,select local system instead of build in system.
Now,it may work.
精彩评论