Appellant, by this action, seeks to recover from the respondent, Barnes county, the sum of $500 and interest as for money had and received for the use and benefit of appellant’s assignor, one A. R. Smith, who deposited such sum with the clerk of the district court of said county in November, 1911, as cash bail for his appearance in the district court to answer to the charge of selling intoxicating liquors contrary to law. In February, 1913, A. R. Smith assigned tó *8appellant any claim which he possessed against defendant county for the recovery of such money.
The defense, briefly stated, was and is that the conditions upon which such bail money was deposited were never complied with in that A. E. Smith absconded and never appeared in the district court to answer to tire charge aforesaid, and that such bail was duly adjudged to be forfeited for such nonappearance, and was ordered to be paid over to the treasurer of defendant county, which order was later complied with.
At the trial in the district court appellant’s counsel sought to show that the order declaring a forfeiture of such bail was a nullity for the alleged reason that the said A. E. Smith, as was his alleged right, appeared through counsel to answer to the charge aforesaid, such charge being merely a misdemeanor. In support of such contention counsel rely upon § 9872, Eev. Codes 1905, § 10709, Comp. Laws 1913, which in effect provides that if the information or indictment is for a misdemeanor a defendant may appear upon arraignment by counsel, and his personal appearance is unnecessary. Such offer of proof was rejected apparently upon the ground that the complaint was not broad enough to permit such proof, or, in other words, that the validity of such order forfeiting the bail could not bé questioned collaterally in this manner.
At the conclusion of the trial the court directed a verdict in defendant’s favor. Thereafter judgment was entered pursuant thereto, and this appeal is both from such judgment and from an order denying plaintiff’s motion for a new trial. As stated by appellant’s counsel, the specifications of error all relate to the rulings of the lower court in excluding evidence offered by plaintiff in support of his alleged cause of action, and they may therefore be considered together and in a general manner.
Conceding all that appellant claims with reference to’ the alleged errors of the trial court in excluding the testimony offered by him, still, unless such rulings were prejudicial, he cannot complain. We fail to see how they were prejudicial. The whole basis upon which appellant’s cause of action is predicated appears to us to be without foundation. He assumes that in equity and good conscience he is entitled to recover such bail money because, forsooth, the trial court in the *9criminal action in which such bail was furnished exceeded its jurisdiction in assuming to declare such bail forfeited, for the reason that, the charge being merely a misdemeanor, the defendant therein had the statutory right to and did appear through his 'attorney. Granting all this to be true, does it follow that in equity and good conscience plaintiff’s assignor was entitled to a return of such bail money ? Clearly not. Had no such forfeiture been adjudged by the trial court such bail money would rightfully and legally have remained in the custody of the clerk until- the conditions of the bail were complied with. The evident fallacy in appellant’s contention consists in the unwarranted assumption that the conditions of the cash bail -were satisfied merely by defendant’s appearance through his counsel for arraignment; but such is not the law as we view it. On the contrary, § 10264, Rev. Codes 1905, § 11122, Comp. Laws 1913, prescribes the terms of an undertaking of bail, and among other conditions are the following: “. . . that the above named . . . (naming the defendant) . . . will at all times hold (or surrender) himself amenable to the orders and process of the court, and, if convicted, will appear for judgment, and render himself in execution thereof.” Where a cash deposit for bail is made the like conditions obtain. See § 10261, Rev. Rodes 1905, § 11119, Comp. Laws 1913, which prescribes that “a deposit of the sum of money mentioned in the order admitting to bail is equivalent to bail,” etc. If' an undertaking of bail had been given instead of a cash deposit in lieu thereof, no one would contend that such bail was exonerated by defendant’s appearance upon arraignment, either personally or through counsel.
This is a complete answer to appellant’s contention that he is entitled to recover the amount of such deposit as for money -had and received. If, therefore, such bail was improperly forfeited, as appears to be the holdings under statutes like ours (People v. Ebner, 23 Cal. 158; People v. Budd, 57 Cal. 349; Neaves v. State, 4 Tex. App. 1; People v. Miller, 63 App. Div. 11, 71 N. Y. Supp. 212; People v. Welch, 88 App. Div. 65, 84 N. Y. Supp. 703; State ex rel. Gleim v. Evans, 13 Mont. 239, 33 Pac. 1010), still this fact would not authorize a suit to recover the deposit as for money had and received without a showing that the conditions of such bail had been complied with. No such showing was *10attempted to be made. The only remedy in such a case would be an application to reinstate such bail.
Upon the question generally as to exoneration of bail by an appearance through counsel where the defendant is charged with a misdemean- or, see Warren v. State, 19 Ark. 214, 68 Am. Dec. 214; State v. Johnson, 27 L.R.A.(N.S.) 943, and note (82 Kan. 450, 108 Pac. 793) ; 3 R. C. L. p. 45.
Judgment affirmed.