Click here to Skip to main content
15,944,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have wite a site in visual stadio 2010 with with C#. i have a Microsoft SQLSERVER 2008 on my system and my os is win7.also the SQLEXPRESS of vis 2010 is installed on my system.
firstly my database was on SQLSERVER 2008.
so i carry my database file to APP_DATA folder in my asp solution and attach automaticly to sqlexpress.
i try use my sit on iis but can not connect database,pages is opend but database not work.and this error is created on my browser:

"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."
how can i solve this problem?
and my connection string in web.config is:

        <remove name="LocalSqlServer" />
    <add name="Porpos_webConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Porpos_web.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient">

1 solution

Share this answer
Comments 6-Sep-12 15:44pm    

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900