The smoothed particle hydrodynamics(SPH) method is applied to solving the shallow water equation of the one-dimensional dam-break problem.To remedy deficiency of the SPH method in dealing with boundary conditions,the virtual particle method is introduced for processing boundary conditions.Compared with the results in related literature by other methods,the curve obtained by the SPH method is sharper in the discontinuous place and smoother in other places,which shows that the SPH method can capture the shock wave well and is accurate.