Devasayani Ekadashi Vrat Katha, or the story associated with Deva Sayni, was first narrated by Lord Brahma to Narada. The story was later told to Yudhishtira by Lord Krishna and is found in the Bhavisyottara Purana.
Legend has it that once there lived a pious King named Mandata and he ruled over a highly prosperous kingdom.
But the prosperity of the kingdom was once affected by lack of rain for three years. There was widespread famine the kingdom. No farming activity was taking place in the kingdom.
There is a popular belief that a kingdom suffers due to the sinful activity of the King. But King Mandata was not able to find what fault he had committed to invite the wrath of Narayana, who is believed to produce the rains.
The king decided to go on a journey and he met several holy men and discussed the problem but none of them offered any solutions. Finally, King Mandata met Sage Angira who suggested that the King should not worry about the reason for no rain but should try to find a solution to bring back the rains.
Sage Angira advised King Mandata to observe the Deva Sayani Ekadasi which falls during the Shukla Paksha of Ashada month. It has the power to the remove the sinful reactions.
King Mandata went back to the palace and he along with his family members and courtiers observed the Deva Sayani Ekadasi and soon the rains arrived. This also helped in regaining the lost glory of the Kingdom.
You may also like to read