can't create more than max_prepared_stmt_count in .net core mysql C#

Viewed 53

I have a .net core 3.1 application in which i am getting following error. I am using mysql 8.0 as backend

 using (var dbCmd = Connection.CreateCommand())
                {
                    // Set the command string
                    dbCmd.CommandText = CommandText;
                    // Set the command type
                    dbCmd.CommandType = CommandType;
                  

                    // run for all events
                    foreach (var e in chunk)
                    {
                        // clear parameters that have been set
                        dbCmd.Parameters.Clear();

                        // Set the parameter values
                        foreach (var param in m_parameters)
                        {
                            param.Prepare(dbCmd);
                            param.FormatValue(dbCmd, e);
                        }
                        dbCmd.Prepare();
                        // Execute the query
                        dbCmd.ExecuteNonQuery();
                    }
                }
0 Answers
Related