MySQL error

04/20/2020 23:22 denominator#1
Okay not sure if it's something to do with the source or the database but the error I get is

Code:
[10:13:19] MySql.Data.MySqlClient.MySqlException (0x80004005): Field 'NextSteedColor' doesn't have a default value
   at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
   at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
   at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId)
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
   at Desco_Pj.Database.MySqlCommand.Execute(MySqlConnection conn) in C:\Users\alank\Downloads\SourceV1[conquer]\SourceV1\SourceV1\Database\MySql\MySqlCommand.cs:line 349
   at Desco_Pj.Database.MySqlCommand.Execute() in C:\Users\alank\Downloads\SourceV1[conquer]\SourceV1\SourceV1\Database\MySql\MySqlCommand.cs:line 318
   at Desco_Pj.Database.ConquerItemTable.AddItem(ConquerItem& Item, GameState client) in C:\Users\alank\Downloads\SourceNightMareV1[conquer]\SourceV1\SourceV1\Database\ConquerItemTable.cs:line 381
04/21/2020 04:45 pintinho12#2
Quote:
Originally Posted by denominator View Post
Okay not sure if it's something to do with the source or the database but the error I get is

Code:
[10:13:19] MySql.Data.MySqlClient.MySqlException (0x80004005): Field 'NextSteedColor' doesn't have a default value
   at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
   at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
   at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId)
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
   at Desco_Pj.Database.MySqlCommand.Execute(MySqlConnection conn) in C:\Users\alank\Downloads\SourceV1[conquer]\SourceV1\SourceV1\Database\MySql\MySqlCommand.cs:line 349
   at Desco_Pj.Database.MySqlCommand.Execute() in C:\Users\alank\Downloads\SourceV1[conquer]\SourceV1\SourceV1\Database\MySql\MySqlCommand.cs:line 318
   at Desco_Pj.Database.ConquerItemTable.AddItem(ConquerItem& Item, GameState client) in C:\Users\alank\Downloads\SourceNightMareV1[conquer]\SourceV1\SourceV1\Database\ConquerItemTable.cs:line 381
Field 'NextSteedColor' doesn't have a default value
04/21/2020 09:03 turk55#3
Desco_Pj.Database.ConquerItemTable.AddItem(Conquer Item& Item, GameState client) in C:\Users\alank\Downloads\SourceNightMareV1[conquer]\SourceV1\SourceV1\Database\ConquerItemTable.cs:li ne 381

Go there and give 'NextSteedColor' a value.
04/21/2020 14:49 denominator#4
Line 381 isn't NextSteedColor though it is

cmd.Insert("ID", Item.ID).Insert("UID", Item.UID)

Turns out it had nothing to do with the source at all and was due to the database with NextSteedColor not being set to null
04/21/2020 21:09 Super Aids#5
The error told you that already.
04/21/2020 22:01 denominator#6
I would agree but it never said anything about it needing to be null just that it was something to do with the database I just assumed that changing it to null might fix the problem which it did
04/22/2020 19:54 Super Aids#7
It didn't need to be null, it just needed a default value. Null is a default value but it could be anything really.