24 VAC sprinkler valve using DC power
The best way to do this would be to get a solenoid valve rated for 24 VDC.

Your existing valve may or may not be rated for DC operation. We have no way of telling, since you didn't tell us which one it is.