471,066 Members | 1,361 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

SqlException: "Generating user instances in SQL Server is disabled"

Hello,
I have started programming ASP.NET application using SQL Server 2005 Express
Edition. The problem is that when C# code tries to access aspnetdb database,
for example:
System.Security.Principal.IPrincipal user = HttpContext.Current.User;

if (user.IsInRole("Kierownik")) // HERE PROBLEM

....then the following run-time error occurs:

SqlException was unhandled by user code
Generating user instances in SQL Server is disabled. Use sp_configure 'user
instances enabled' to generate user instances.

Unfortunately executing sp_configure 'user instances enabled' on aspnetdb
database doesn't help (still the same error).

Please help.
/RAM/
Nov 25 '07 #1
1 3640
a good way to get over this hurdle is to not use User Instances from the very
beginning, because if you are ever going to deploy your application you won't
be able to use a user-instance connection string at all.
So either attach the ASPNETDB database MDF file, or use ASPNET_REGSQL.EXE or
the System.Web.Management methods to create your ASP.NET membership database
tables, etc. in the database of your choice.

--Peter
"Inside every large program, there is a small program trying to get out."
http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://www.blogmetafinder.com

"R.A.M." wrote:
Hello,
I have started programming ASP.NET application using SQL Server 2005 Express
Edition. The problem is that when C# code tries to access aspnetdb database,
for example:
System.Security.Principal.IPrincipal user = HttpContext.Current.User;

if (user.IsInRole("Kierownik")) // HERE PROBLEM

....then the following run-time error occurs:

SqlException was unhandled by user code
Generating user instances in SQL Server is disabled. Use sp_configure 'user
instances enabled' to generate user instances.

Unfortunately executing sp_configure 'user instances enabled' on aspnetdb
database doesn't help (still the same error).

Please help.
/RAM/
Nov 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Jeremy Langworthy | last post: by
1 post views Thread by Kruse | last post: by
1 post views Thread by Ittay Dror | last post: by
5 posts views Thread by Mark Hannon | last post: by
1 post views Thread by Morten Plathe | last post: by
reply views Thread by damontimm | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.