Rajiv Kumar, from Shahjahanpur district, killed himself in his room at hotel Minar in Bazariya area, they said.
Deputy Superintendent of Police Manisha Singh said Kumar informed his brother-in-law about the step he was going to take through text.
Kumar's brother-in-law reached the hotel this morning. His room was locked from inside and the hotel management had to open it with a duplicate key.
An investigation by the police revealed that Kumar faced some family issues, they said. He had checked into the hotel last night.