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 type: Reconfigure. Then restart the SQL Server database
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:
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!
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.
jitendra2coo...
Member
27 Points
54 Posts
Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled' to...
Aug 04, 2011 07:12 AM|LINK
hi
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 type: Reconfigure.
Then restart the SQL Server database
I am using VS2008 and SQL server 2005.
Pls suggest solution for it.
thanks.
tarun n june...
Contributor
4054 Points
902 Posts
Re: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled...
Aug 04, 2011 07:22 AM|LINK
Please share your web.config connection string
Cheers!
Tarun Juneja
http://meghainfotech.wordpress.com/
jitendra2coo...
Member
27 Points
54 Posts
Re: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled...
Aug 04, 2011 01:16 PM|LINK
Thanks for reply
When i was runnig my web site on local host, connection string was
necro_mancer
Star
8169 Points
1595 Posts
Re: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled...
Aug 05, 2011 02:40 AM|LINK
hi jitendra,
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:
<connectionStrings>
<add name="strConnection"
connectionString="Data Source=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|\Database1.mdf;
Integrated Security=True;
User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
Please mark this response as an "answer" if it helps you. Thank you.
:-)
Professional SQL 2008 R2 Service
jitendra2coo...
Member
27 Points
54 Posts
Re: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled...
Aug 05, 2011 02:35 PM|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.
Rgds,
necro_mancer
Star
8169 Points
1595 Posts
Re: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled...
Aug 06, 2011 02:17 AM|LINK
hi jitendracool,
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!
:-)
Professional SQL 2008 R2 Service
arththakkar
Member
2 Points
1 Post
Re: Generating user instances in SQL Server is disabled. Use sp_configure 'user instances enabled...
Jan 22, 2013 04:21 PM|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.
Please Reply.
Thank you. :)