Hi I have created web based application. I configure with IIS but when its run under iis then it gives 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.
But its running on local machine correctly.
Whats the problem? Should i change my connection string in Web.config?
Thank you.
<appSettings>
<add key="ConnectionString" value="Data Source=.\SQLEXPRESS;AttachDbFilename=D:\NewOnlineExamDemo25\App_Data\OnlineQuiz.mdf;Integrated Security=True;User Instance=True"/>
<add key="Delay" value="1800000" />
</appSettings>
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=D:\NewOnlineExamDemo25\App_D开发者_JS百科ata\OnlineQuiz.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
</connectionStrings>
Check your web.config file for the setting of 'Identity impersonate'. Probably it'll be enough to use the following
<identity impersonate="false"/>
The problem is in your connection string:
value="Data Source=.\SQLEXPRESS;AttachDbFilename=D:\NewOnlineExamDemo25\App_Data\OnlineQuiz.
On the server I don't think that this path; D:\NewOnlineExamDemo25\App_Data\OnlineQuiz
exists.
You have to attach the DB to your SQL server and then set that information in your connection string.
精彩评论