I am using MySQL and .NetCore. I have a table with Json data type. However, I am having trouble registering here via c #. I'm getting an error. How can I save Json data without destroying it?
I am saving Json data through database. But it gives an error with C # code.
sqlconn = new MySqlConnection( ConnectionString ); if (sqlconn.State != ConnectionState.Open) { sqlconn.Open(); } cmd = new MySqlCommand("call Ynkys.sp_JSON_INSERT(2, 22, 'Test', '"+jsonString+"')", sqlconn); cmd.CommandType = CommandType.StoredProcedure; cmd.ExecuteNonQuery();
cmd.ExecuteNonQuery();
{"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Test', '{\"Id\":\"22\",\"Name\":\"AAAAAAAAAA\"}')'' at line 1"}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)