The INSERT statement conflicted with the FOREIGN KEY constraint "FK__AspNetUse__RoleI__628FA481". The conflict occurred in database "Semsark_v1", table "dbo.AspNetRoles", column 'Id'. The statement has been terminated.

System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK__AspNetUse__RoleI__628FA481". The conflict occurred in database "Semsark_v1", table "dbo.AspNetRoles", column 'Id'. The statement has been terminated.

System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK__AspNetUse__RoleI__628FA481". The conflict occurred in database "Semsark_v1", table "dbo.AspNetRoles", column 'Id'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
   at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   --- End of inner exception stack trace ---
   at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.Execute(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Entity.Core.EntityClient.EntityCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Entity.Core.EntityClient.EntityCommand.ExecuteNonQuery()
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteFunctionCommand(EntityCommand entityCommand)
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass4b.<ExecuteFunction>b__49()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteFunction(String functionName, ObjectParameter[] parameters)
   at Semsark.Models.SemsarkEntities.SP_insertUserRole(Nullable`1 roleid, String userid)
   at Semsark.Controllers.AccountController.<Register>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
		

Logged on Monday, December 15, 2025 at 11:37:21 AM

See also:

Server Variables

NameValue
ALL_HTTPHTTP_CONNECTION:close HTTP_PRAGMA:no-cache HTTP_CONTENT_LENGTH:2773 HTTP_CONTENT_TYPE:multipart/form-data; boundary=67e864030b337 HTTP_ACCEPT:*/* HTTP_COOKIE:__RequestVerificationToken=mh_R_d0eXu8g-Llh3voH9o0Yv4tqtMNDd_9xUOtkn29ZIKIsey51jhvPNsDELmOlvB3f_uRAMNghxYpwMNAjqbEhefkAsv0vSLhtuj8BhSc1 HTTP_HOST:www.semsark.com HTTP_REFERER:https://www.semsark.com/Account/Register HTTP_USER_AGENT:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
ALL_RAWConnection: close Pragma: no-cache Content-Length: 2773 Content-Type: multipart/form-data; boundary=67e864030b337 Accept: */* Cookie: __RequestVerificationToken=mh_R_d0eXu8g-Llh3voH9o0Yv4tqtMNDd_9xUOtkn29ZIKIsey51jhvPNsDELmOlvB3f_uRAMNghxYpwMNAjqbEhefkAsv0vSLhtuj8BhSc1 Host: www.semsark.com Referer: https://www.semsark.com/Account/Register User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
APPL_MD_PATH/LM/W3SVC/4/ROOT
APPL_PHYSICAL_PATHC:\inetpub\wwwroot\Semsark2\
AUTH_PASSWORD*****
AUTH_TYPE
AUTH_USER
CERT_COOKIE
CERT_FLAGS
CERT_ISSUER
CERT_KEYSIZE256
CERT_SECRETKEYSIZE2048
CERT_SERIALNUMBER
CERT_SERVER_ISSUERC=US, O=Let's Encrypt, CN=R13
CERT_SERVER_SUBJECTCN=www.semsark.com
CERT_SUBJECT
CONTENT_LENGTH2773
CONTENT_TYPEmultipart/form-data; boundary=67e864030b337
GATEWAY_INTERFACECGI/1.1
HTTP_ACCEPT*/*
HTTP_CONNECTIONclose
HTTP_CONTENT_LENGTH2773
HTTP_CONTENT_TYPEmultipart/form-data; boundary=67e864030b337
HTTP_COOKIE__RequestVerificationToken=mh_R_d0eXu8g-Llh3voH9o0Yv4tqtMNDd_9xUOtkn29ZIKIsey51jhvPNsDELmOlvB3f_uRAMNghxYpwMNAjqbEhefkAsv0vSLhtuj8BhSc1
HTTP_HOSTwww.semsark.com
HTTP_PRAGMAno-cache
HTTP_REFERERhttps://www.semsark.com/Account/Register
HTTP_USER_AGENTMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
HTTPSon
HTTPS_KEYSIZE256
HTTPS_SECRETKEYSIZE2048
HTTPS_SERVER_ISSUERC=US, O=Let's Encrypt, CN=R13
HTTPS_SERVER_SUBJECTCN=www.semsark.com
INSTANCE_ID4
INSTANCE_META_PATH/LM/W3SVC/4
LOCAL_ADDR172.31.24.199
LOGON_USER
PATH_INFO/Account/Register
PATH_TRANSLATEDC:\inetpub\wwwroot\Semsark2\Account\Register
QUERY_STRING
REMOTE_ADDR87.117.58.25
REMOTE_HOST87.117.58.25
REMOTE_PORT20654
REMOTE_USER
REQUEST_METHODPOST
SCRIPT_NAME/Account/Register
SERVER_NAMEwww.semsark.com
SERVER_PORT443
SERVER_PORT_SECURE1
SERVER_PROTOCOLHTTP/1.0
SERVER_SOFTWAREMicrosoft-IIS/10.0
URL/Account/Register