On the one hand, there's the holodeck, perhaps the most perfectly insane entertainment device every created for a science fiction show; it can give you anything, simulate anything, and make you part of a story, and if you're really lucky, it can even generate a powerful artificial intelligence seemingly at random.
He is supposed to be giving away the bride – Keiko Ishikawa – at her wedding to Chief O'Brien.
Unfortunately, she has cold feet and decided not to go through with it.
After confirming that this will make her happy, Data cheerily informs Chief O'Brien of the devastating news before moving on to the day's next task.
Part of his duties involve assisting Picard and a recently-boarded Vulcan, Ambassador T'Pel.
They have arranged a secret meeting with the Romulans, but Picard is being very secretive about it (which is almost always the sign that something bad is going to happen).
At one point T'Pel meets Data in secret and grills him for the Enterprise's defense capabilities.
When Data says he'll have to report this request, T'Pel withdraws it claiming that it was a test.
Yes, that's right, a little test to see which of us is the traitor.
Data decides that since Vulcans do not lie, she can't be lying.
Since Geordi has assured him that the wedding will go ahead, Data realises he needs to learn how to dance.
"The Mind's Eye" Or The One Where Reading Rainbow Gets His Wires Crossed You gotta love the blind spots of the TNG writing team.