public void _insert(string query = "") { Class_conexion class_cnx = new Class_conexion(); MySqlConnection cnx = new MySqlConnection(class_cnx._conexion("2")); cnx.Open(); MySqlCommand cmd = new MySqlCommand(query, cnx); cmd.ExecuteNonQuery(); cnx.Close(); }
public DataTable _ejecutar(string query = "", string tabla = "") { dtequipos.Clear(); Class_conexion class_cnx = new Class_conexion(); MySqlConnection cnx = new MySqlConnection(class_cnx._conexion(tabla)); cnx.Open(); MySqlCommand cmd = new MySqlCommand(query, cnx); MySqlDataAdapter da = new MySqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); dtequipos = ds.Tables[0]; cnx.Close(); return(dtequipos); }