By doing
I get the error.Code:Sql.Builder.Append($"SELECT * FROM kits LEFT JOIN kits_reloading ON kits.id=kits_reloading.kit_id WHERE kits_reloading.steam_id = {SteamUserID};");
MySql handle raised an exception (ArgumentException: An element with the same key already exists in the dictionary.)
ArgumentException with Dictionary and MySQL
Discussion in 'Rust Development' started by ☜☢LeshaBiceps☢☞, Mar 13, 2017.
-
Wulf Community Admin
Dictionary keys are unique and you cannot have more than one of the same key. This is a standard C# exception.
-
-
As far as i understood, Oxide cannot handle multiple columns with same name due to the limitations imposed by the Dictionary.
And it's totally correct, why the heck you gotta have two identical columns in query result?
You need to rewrite your sql query, namely you should qualify columns instead of just using * shorthand. -
Maybe someone interested is the code
Code:SELECT kits.*, kits_reloading.time_used FROM kits LEFT JOIN kits_reloading ON kits.id=kits_reloading.kits_id WHERE kits_reloading.steam_id = {SteamUserID};
-
As php is automatically replace the array[key] when it exist, c#/c++ don't do it because of Dictionnary purpose