Error occured while creating User using Usercontrol?
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_umbracoUser2app_umbracoUser". The conflict occurred in database "UmbracoCMS", table "dbo.umbracoUser", column 'id'.<br>The statement has been terminated.
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
Hi all,
I am getting the following error while creating the user using my .net usr control.Any one please guide me.
vijay.
Server Error in '/' Application.
The INSERT statement conflicted with the FOREIGN KEY constraint
"FK_umbracoUser2app_umbracoUser". The conflict occurred in database
"UmbracoCMS", table "dbo.umbracoUser", column 'id'. The statement has been
terminated.
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: The INSERT statement conflicted with the
FOREIGN KEY constraint "FK_umbracoUser2app_umbracoUser". The conflict occurred
in database "UmbracoCMS", table "dbo.umbracoUser", column 'id'. The statement
has been terminated.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Error occured while creating User using Usercontrol?
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_umbracoUser2app_umbracoUser". The conflict occurred in database "UmbracoCMS", table "dbo.umbracoUser", column 'id'.<br>The statement has been terminated. body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
Hi all,
I am getting the following error while creating the user using my .net usr control.Any one please guide me.
vijay.
Server Error in '/' Application.
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_umbracoUser2app_umbracoUser". The conflict occurred in database "UmbracoCMS", table "dbo.umbracoUser", column 'id'.
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.The statement has been terminated.
Exception Details: System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_umbracoUser2app_umbracoUser". The conflict occurred in database "UmbracoCMS", table "dbo.umbracoUser", column 'id'.
The statement has been terminated.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
How did you create the new user?
Hi Richard,
I am creating user using following code
UserType ut = UserType.GetUserType(3);
User.MakeNew("arun", "salgaonkar", "tushar", ut);
User u = new User("tushar");
u.addApplication("settings");
u.Save();
Then above error comes but user is created.
---vijay.
It looks like you do not check if the user already exist. So of course you would get this error.
You can check if the user exists like so:
thanks for your reply
----vijay.
is working on a reply...