hosting asp.net
I have an asp.net application and i use the login control. It uses the default aspnetdb.mdf. Everything worked fine on the local network but when i hosted the website on the internet, the login doesnt work. It gave me the error:
"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 connection string for the database is:
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" pr开发者_开发知识库oviderName="System.Data.SqlClient" />
User Instances (the AttachDBFilename
part of your connection string) is a feature of SQL Server Express, and I am guessing your host services use the full version of SQL Server (that does not support that feature).
You will probably need to connect to your hosted SQL Server using SQL Server Management Studio and upload your database there. Then you will need to update your connection string to point to that server/database.
精彩评论