public static void InsertMysqlService() { ConectarTedef(); string query = "select * from ts_nomenclador where ruc = '20494306043' and flag = '0' order by codigo"; OleDbCommand commandselect = new OleDbCommand(query, Conex); OleDbDataReader reader = commandselect.ExecuteReader(); while (reader.Read()) { if (!CategoryServiceExists(reader)) { ConnectionMySQL.Connect(); ConnectionMySQL.InsertCategoryService(Helper.SplitPoints(reader.GetString(1))); ConnectionMySQL.Disconnect(); } if (!SubCategoryServiceExists(reader)) { ConnectionMySQL.Connect(); ConnectionMySQL.InsertSubCategoryService(Helper.SplitPoints(reader.GetString(1))); ConnectionMySQL.Disconnect(); } ConnectionMySQL.Connect(); ConnectionMySQL.InsertService(Helper.SplitPoints(reader.GetString(1)), reader.GetString(2), reader.GetString(3), reader.GetString(4)); ConnectionMySQL.Disconnect(); UpdateAfterInsert("ts_nomenclador", "CODIGO", 1, reader); } Desconectar(); FinalMessage(); }