Last post Jan 22, 2013 12:21 PM by arththakkar
Aug 04, 2011 03:12 AM|jitendra2cool|LINK
i have deployed my website. I have log in page to enter in to it. When i tried to logged in,i got following error.
Description: An unhandled exception occurred during the execution of the current web request. Please review
the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to generate user instances.
My website worked properly when i was running on localhost. I have also tried the following command in my SQL server
mgmt studio and it executed successfully.
In the query editor type this text:
exec sp_configure 'user instances enabled', 1.
Then restart the SQL Server database
I am using VS2008 and SQL server 2005.
Pls suggest solution for it.
Aug 04, 2011 03:22 AM|tarun n juneja|LINK
Please share your web.config connection string
Aug 04, 2011 09:16 AM|jitendra2cool|LINK
Thanks for reply
When i was runnig my web site on local host, connection string was
<add name="DatabaseConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="
D:\SOMAIYA\App_Data\Database.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"
When i deployed the web site, i changed it to following
<connectionStrings> <add name="ConnectionName" connectionString="Database=Database.mdf;Server=22.214.171.124,1445;User ID=admin;
Password=******;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient"/></connectionStrings>
Here User ID and Password are Log In name and Password of my Log in page
Aug 04, 2011 10:40 PM|necro_mancer|LINK
The issue has little thing to do with your web.config. The issue you are experiencing is due to the fact that the default installation of SQL Server Express has
disabled user instance. To resolve this issue simply:
1. Open a SQL Server 2005 Management Studio Express.
2. Connect to the default instance of that server (PC-Name\SQLEXPRESS)
3. Open a New Query Window, ensure that you are connecting to the master database
4. Type: exec sp_configure 'user instances enabled', 1
5. Type: RECONFIGURE
6. Restart the SQL Server
One last thing, please ensure that your connection string resembles this format:
Please mark this response as an "answer" if it helps you. Thank you.
Aug 05, 2011 10:35 AM|jitendra2cool|LINK
Thanks for your help.
But this is my first hosting. Kindly guide me keeping that in mind..
I have created Database.mdf file & put it in app_data folder.
My application is running perfectly in local host.
By FTP I have transferred all my files along with App_data folder to your server. httpdocs folder.
What changes I have to make in control panel of server site to access my Database.mdf file of App_data folder. ?
OR is there any other way to work... ?
I would appreciate your guidance.
Aug 05, 2011 10:17 PM|necro_mancer|LINK
Have you contacted your current host to report on this problem? Your host can help you better as they have all the server information necessary for your website. I do not know how they configure their server, but obviously, with this error message, there is
something wrong on the DB server setup. Only they as the server administrator can disarm this error message.
If you still cannot get a satisfactorily answer from them, I would recommend you to move to another host. One that I can recommend is
asphostcentral.com, which has supported SQL 2008 R2.
Please mark this response as an "answer" if it helps you. Thanks a lot!
Jan 22, 2013 12:21 PM|arththakkar|LINK
Can I get solution without doing changes in SQL Server 2005 Management Studio that you have mentioned.?
I am having the same problem and I have tried by replacing the code in web.config as shown in your sugesion.
Thank you. :)