Electrical distribution networks are facing today a dramatic increase of the Distributed Generation (DG). This augmentation induces voltage issues that conventionnal voltage control devices cannot avoid anymore. As a consequence, the number of DG that can be connected on distribution networks is limited. This thesis proposes an innovative voltage control method called DMIP (Decoupled Mixed Integer Programming). This method is based on a real time optimal management of reactive power of DG and of discrete variables of the system. Simulations undertook shows that this algorithm allows a signicant increase of number of DG connected and an optimization of Joule losses. Moreover, compared to other algorithms available in the literature, DMIP oers more modularity and more exibility. Supplementary studies show that the DMIP concept can be applied to other systems. Thus, an optimal voltage control based on DMIP has been developed for wind farms. It allows an optimal control of voltage within wind farms while keeping the voltage or the reactive power at the point of common coupling at a specied setpoint. The voltage control developed in this thesis is one of the solutions that will make future distribution networks, the Smart Grids, more reliable.