Parser MapMonster

12/21/2019 12:12 pauvm1618#1
An error occurred while updating the entries. See the inner exception for details.
System.Data.Entity.Infrastructure.DbUpdateExceptio n: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Instrucción INSERT en conflicto con la restricción FOREIGN KEY 'FK__MapMonste__MapId__22D5121F'. El conflicto ha aparecido en la base de datos 'opennos', tabla 'dbo.Map', column 'MapId'.
Se terminó la instrucción.
at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(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.SqlCommand.FinishExecuteRead er(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderT ds(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.InternalExecuteNo nQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Data.Entity.Infrastructure.Interception.Int ernalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbC ommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)
at System.Data.Entity.Core.Mapping.Update.Internal.Dy namicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
at System.Data.Entity.Core.Mapping.Update.Internal.Up dateTranslator.Update()
--- End of inner exception stack trace ---
at System.Data.Entity.Core.Mapping.Update.Internal.Up dateTranslator.Update()
at System.Data.Entity.Core.Objects.ObjectContext.Exec uteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectContext.Save ChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)
at System.Data.Entity.SqlServer.DefaultSqlExecutionSt rategy.Execute[TResult](Func`1 operation)
at System.Data.Entity.Core.Objects.ObjectContext.Save ChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)
at System.Data.Entity.Internal.InternalContext.SaveCh anges()
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.InternalContext.SaveCh anges()
at OpenNos.DAL.DAO.MapMonsterDAO.Insert(IEnumerable`1 mapMonsters) in C:\Users\Pau\Desktop\Source\nosbyte-latest\OpenNos.DAL.DAO\MapMonsterDAO.cs:line 79

I get this error when parsing the mapmonster, anyone can help? (Cryless source)
12/21/2019 13:00 Irelia<3#2
@[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Search on your Source.
"dbo.MapMonster"

and thisable on this Screenshot the foreignKey
and kill the foreignKey on your Database on the table: MapMonsters -> Foreign Key

Regards Irelia<3

BTW: i wish all Epvp Members nicly holiday and i hope i can help all members on this time it is Christmas.
12/21/2019 14:25 pauvm1618#3
still doesnt work
12/21/2019 20:23 0Lucifer0#4
Quote:
Originally Posted by Irelia<3 View Post
@[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Search on your Source.
"dbo.MapMonster"

and thisable on this Screenshot the foreignKey
and kill the foreignKey on your Database on the table: MapMonsters -> Foreign Key

Regards Irelia<3

BTW: i wish all Epvp Members nicly holiday and i hope i can help all members on this time it is Christmas.
So remove code until it works ? Why not just fix it by adding a check ?
12/21/2019 20:34 Irelia<3#5
@[Only registered and activated users can see links. Click Here To Register...]

Whats for check? i mean the ForeignKey is false on this side i think is a complicate with a PrimaryKey another DBO Key
12/21/2019 20:39 0Lucifer0#6
Quote:
Originally Posted by Irelia<3 View Post
@[Only registered and activated users can see links. Click Here To Register...]

Whats for check? i mean the ForeignKey is false on this side i think is a complicate with a PrimaryKey another DBO Key
The foreign key is totally legit. You just want to check your constraint is respected. A monster can’t be on a map that doesn’t exist. So just check that the map of every monsters exist and remove those that doesn’t.