Dear Client,
B can fight his case on the basis of the registered sale deed. He does not need to file a suit for declaration if he has evidence to prove that he has been in possession of the property since the date of purchase.
However, if he has not been living in the property and the other party has taken advantage of his absence to grab the property, then B can file a suit for declaration, mandatory injunction, and permanent injunction. The mandatory injunction would require the other party to remove any obstacles they have created on the property, and the permanent injunction would prevent the other party from interfering with B's possession and enjoyment of the property.
The DC is competent to inquire into the alleged change of khata records and can even punish the erring official. However, the DC is not the authority to decide about B's title or to evict the unauthorised or illegal occupier from the property.
Here is a more concise version:
B can use the registered sale deed to fight his case. If he has not been living in the property, he can file a suit for declaration, mandatory injunction, and permanent injunction. The DC can investigate the khata records, but they cannot decide about B's title or evict the occupier.