1. The case of a suit against a railroad company in a county other than the county of its principal place of business, is one where the jurisdiction turns on the subject matter. It is not the case of a plea of want of jurisdiction of tlie person ; *501that is waived by appearance and pleading to tbe merits. But in these eases the right to sue in the county in which the suit is brought turns on the locality of the cause of action; It must appear on the face of the pleadings that the cause of action originated, that is, that the contract was made or to be performed in the county; it is that which gives the jurisdiction, and that was alleged in this declaration, and it was the duty of the plaintiff to prove it. To. do so involved an inquiry into the whole case, and a plea to the jurisdiction would have involved an inquiry and a trial of the merits. In such cases the denial of the plaintiff’s right to recover denies the jurisdiction. Would a party, by failing to plead to the jurisdiction in abatement, in an' action of ejectment, waive the right to have an action to try titles tried in the county where the land lies? We think this is just such a case. The jurisdiction is of the subject matter; that cannot be conferred by waiver. If it appear on the trial, the party may except. If he failed to except or-object, and the proper allegations were in the declaration, he would be barred.' But he does this as soon as it appears from the plaintiff’s proof (which he must make) that the court does not have jurisdiction of the subject matter. Suppose in a justice court the suit was for $99.00, and it appeared on the trial that the claim was in fact for $105 00, how can the defendant know what the plaintiff will prove until by the facts, as the plaintiff makes them, the truth appears? We think this is not the case of a plea to the jurisdiction of the person, but an objection that the plaintiff has, by his own proof, shown that the court has not a right to try the subject matter.
2. Under the facts as proven, the case was not one which the superior court had power, under the law, to try; the contract was not made or to be performed in Greene county: Code, section 3406. The money, if paid improperly, was paid in Richmond, and the law raised, if it was paid improperly, an implied promise then and there to .pay it back; that is the plaintiff’s right of action.
. Judgment reversed.
*502Warner, Chief Justice, concurred,