
203 S.W.3d 1 (2006)
OHBA CORPORATION D/B/A IRISHMAN'S CREEK APARTMENTS, Appellant,
v.
CITY OF CARROLLTON, Appellee.
No. 05-05-00215-CV.
Court of Appeals of Texas, Fifth District, Dallas.
Opinion Filed August 22, 2006.
Before Justices MOSELEY, BRIDGES, and O'NEILL.

OPINION
Opinion By Justice MOSELEY.
OHBA Corporation d/b/a Irishman's Creek Apartments filed suit seeking a declaratory judgment and an injunction regarding the City of Carrollton's enforcement of its housing code. OHBA alleges the City cited the property manager for violations of the housing code at the property without giving OHBA formal notice and an administrative appeal of the building inspector's determination the property was substandard. The trial court granted the City's plea to the jurisdiction and dismissed the lawsuit with prejudice. OHBA appeals, arguing it has standing to sue and a justiciable controversy with the City over its right to notice and an administrative appeal. We conclude there is no justiciable controversy between these parties and that OHBA lacks standing to assert its claims. We affirm the trial court's judgment.

Background
As alleged by OHBA, section 202 of the uniform housing code adopted by the City (the "code") requires that buildings determined to be substandard shall be abated in accordance with chapter 11 of the code. That chapter requires the City to give notice to the record owner of the property of its determination, and gives the owner the right to an administrative appeal. Also, as alleged by the City, section 204 of the code makes it "unlawful for any person, firm or corporation to . . . use, occupy, or maintain any building or structure . . . in violation of [the code]," and a violation of the code is a Class C misdemeanor.
OHBA alleges it owns an apartment complex in Carrollton, and that City inspectors had determined the property violated the code and the City served requests for repairs to "third parties." The petition does not clearly identify the third parties, but apparently refers to the president of the management company hired by OHBA to manage the property. OHBA alleged the City then cited the property manager for failure to take action to correct certain code violations and that City inspectors "continue to serve notices and citations on such party." OHBA alleges the City never gave it the requisite notices of the City's determination of violations and the City thus has denied OHBA its right to appeal those determinations in accordance with chapter 11 of the code. OHBA sought a declaratory judgment that the ordinances require the City to give it notice and an administrative appeal regarding any code violations. It also sought an injunction to prevent the City from issuing any repair orders to OHBA or its agents without providing notice and an administrative appeal.
The City filed a plea to the jurisdiction alleging the trial court lacked subject matter jurisdiction because there is no justiciable controversy between the parties, OHBA has no standing to complain of the actions against the property manager, the City has governmental immunity from suit, and the court lacked jurisdiction to enjoin enforcement of a penal ordinance. At the hearing on the City's plea, five misdemeanor citations were admitted in evidence. The citations charged the property manager with maintaining the building in violation of the code due to faulty weather protection in certain units caused by a crack in the exterior brick wall or by a lack of paint. The citations were issued involving different units in the complex on two dates six months apart. There was also evidence that the misdemeanor citations issued to the property manager were still pending in the municipal court, but that no actions were pending by the City against OHBA regarding the property, and there were no violations of City ordinances at the property at the time of the hearing.
The trial court granted the plea to the jurisdiction and dismissed the lawsuit with prejudice for lack of subject matter jurisdiction.

Standard of Review
A plea to the jurisdiction is a dilatory plea that seeks dismissal of a case for lack of subject matter jurisdiction. Bland Indep. Sch. Dist. v. Blue, 34 S.W.3d 547, 554 (Tex. 2000). Whether a trial court has subject matter jurisdiction is a question of law to be reviewed de novo. Tex. Natural Res. Conservation Comm'n v. IT-Davy, 74 S.W.3d 849, 855 (Tex. 2002). In performing this review, we do not look to the merits of the plaintiff's case, but consider only the pleadings and the evidence pertinent to the jurisdictional inquiry. Tex. Dep't of Parks & Wildlife v. Miranda, 133 S.W.3d 217, 227 (Tex. 2004); County of Cameron v. Brown, 80 S.W.3d 549, 555 (Tex. 2002).

Discussion
OHBA's raises five issues on appeal: (1) it has standing to sue and has asserted a justiciable controversy; (2) the declaratory judgments act waives governmental immunity; (3) the trial court had jurisdiction over its claim for injunctive relief; (4) jurisdiction over any one of its claims was enough to deny the plea to the jurisdiction; and (5) the trial court should have allowed it to amend its pleadings before dismissal.
Standing is a component of subject matter jurisdiction and cannot be waived. Tex. Ass'n of Bus. v. Tex. Air Control Bd., 852 S.W.2d 440, 445 (Tex. 1993). It is a constitutional prerequisite to maintaining a suit under both federal and Texas law. Id. at 444. Under Texas law, standing limits subject matter jurisdiction to cases involving a distinct injury to the plaintiff and "a real controversy between the parties, which . . . will be actually determined by the judicial declaration sought." Brown v. Todd, 53 S.W.3d 297, 305 (Tex. 2001) (quoting Tex. Workers' Compensation Comm'n v. Garcia, 893 S.W.2d 504, 517-18 (Tex. 1995)).
A declaratory judgment is appropriate only if a justiciable controversy exists as to the rights and status of the parties and the controversy will be resolved by the declaration sought. Bonham State Bank v. Beadle, 907 S.W.2d 465, 467 (Tex. 1995). To constitute a justiciable controversy, there must exist a real and substantial controversy involving a genuine conflict of tangible interests and not merely a theoretical dispute. Id.; Tex. Dep't of Public Safety v. Moore, 985 S.W.2d 149, 153 (Tex. App.-Austin 1998, no pet.). The declaratory judgments act is "merely a procedural device for deciding cases already within a court's jurisdiction rather than a legislative enlargement of a court's power, permitting the rendition of advisory opinions." Tex. Ass'n of Bus., 852 S.W.2d at 444.
OHBA argues it has a personal stake in a live controversy because the City determined its property was substandard under the uniform housing code when the City issued the citations to the property manager. OHBA contends the City made this determination without affording OHBA its rights to notice and to appeal the determination under chapter 11 of the uniform housing code. The City says it has a choice of remedies when it determines a property is substandard: it may order the owner to repair, replace, or abate the substandard condition under chapter 11, or it may cite any person who uses, occupies, or maintains a building in violation of the housing code, or both. The City claims that OHBA has no standing to challenge the City's choice of remedies and that any concerns about the substandard determination can be resolved within the specific proceedings for the remedy sought by the City. For example, the City argues that in the misdemeanor cases against the property manager, it must prove the property was substandard on the dates alleged in the citation and that the manager can attempt to rebut that proof and show the property was not substandard. According to the City, this procedure fully protects whatever rights OHBA has regarding the determination that the property is substandard.
The controversy here centers around the citations issued to the property manager hired by OHBA. The citations were issued for maintaining specific units in the apartment complex in violation of the housing code on two different dates six months apart. No citations were issued to OHBA. Although OHBA alleges generally that the City continues to serve notices and citations to the property manager, the evidence at the hearing indicates no other actions were pending by the City regarding the property and there were no present code violations at the property. OHBA does not challenge the validity or constitutionality of any of the ordinances. It does not appear to challenge the validity of the particular citations issued to the property manager. It seeks only that it be afforded a particular form of notice and that it be afforded an administrative appeal. The allegations indicate that OHBA received some notice of the violations through its agent, the property manager. Yet OHBA does not allege it attempted to file an administrative appeal and was denied. Based on the allegations in the petition, there is no live controversy between OHBA and the City that would be resolved by the declaration OHBA seeks.
Further, the declaration OHBA seeks will not resolve the pending misdemeanor charges against the property manager because OHBA does not assert or seek a determination that the building was not substandard on the dates alleged in the citations; nor does it seek an administrative appeal of those particular determinations. Instead, OHBA seeks a declaration regarding a future, hypothetical situation: that if the City should determine the property to be substandard, it must give a particular notice to OHBA and advise it of its right to an administrative appeal. OHBA does not allege or show that there is a real, immediate threat that the City will determine the property or portions thereof is substandard and deny OHBA an administrative appeal.
The declaratory judgments act does not give courts the power to rule on hypothetical or contingent situations, or to determine questions not then essential to the decision of an actual controversy, even though the questions may require adjudication in the future. Firemen's Ins. Co. v. Burch, 442 S.W.2d 331, 333 (Tex. 1968). From the allegations in the petition and the evidence received regarding jurisdiction, we cannot conclude there is a real and substantial controversy between these parties involving a genuine conflict of tangible interests. Beadle, 907 S.W.2d at 467. This case presents merely a theoretical dispute and any existing dispute will not be resolved by the declaration OHBA seeks. Thus the trial court lacked subject matter jurisdiction over the declaratory judgment claim.
OHBA's request for injunctive relief is no different because it is based on the declaratory relief OHBA seeks and there is no "real controversy between the parties, which . . . will be actually determined by the judicial declaration sought." Brown, 53 S.W.3d at 305. We conclude OHBA lacks standing to seek injunctive relief. See Camarena v. Tex. Employment Comm'n, 754 S.W.2d 149, 151 (Tex. 1988) (trial court has no jurisdiction to grant injunctive relief based on a hypothetical situation which might or might not arise at a later date).
Because OHBA lacks standing to sue and does not have a justiciable controversy with the City, we resolve OHBA's first, third, and fourth issues against it. We need not address the second issue regarding governmental immunity. Tex. R. App. P. 47.1. In its fifth issue, OHBA argues it should have been given an opportunity to amend its pleadings before the trial court dismissed its suit for want of jurisdiction. Normally, if the pleadings fail to contain facts sufficient to demonstrate the trial court's jurisdiction, the issue is one of pleading sufficiency and the plaintiff should be permitted an opportunity to amend. Miranda, 133 S.W.3d at 227; Brown, 80 S.W.3d at 555. However, if the pleadings affirmatively negate the existence of jurisdiction, a plea to the jurisdiction may be granted without affording the plaintiff an opportunity to amend. Miranda, 133 S.W.3d at 227; Brown, 80 S.W.3d at 555. Further, if the plea to the jurisdiction attacks the existence of jurisdictional facts and if evidence on the jurisdictional issue is submitted, the trial court may determine the issue at the preliminary hearing or await a fuller development of the case. Miranda at 227. The trial court should determine whether the evidence creates a fact question regarding the jurisdictional issue or is undisputed. Id. at 227-28. If the evidence is undisputed or does not raise a fact question, the trial court rules on the plea to the jurisdiction as a matter of law. Id.
Here, the City attacked the existence jurisdictional facts and the evidence at the hearing was undisputed. Under these circumstances, the trial court was correct to determine the jurisdictional question as a matter of law. Id.
OHBA also asserts its lawsuit should not have been dismissed with prejudice. In general, a dismissal with prejudice is improper when the plaintiff is capable of remedying the jurisdictional defect. See Harris County v. Sykes, 136 S.W.3d 635, 639 (Tex. 2004). The supreme court has determined that dismissal with prejudice is appropriate when a trial court lacks subject matter jurisdiction because of the sovereign immunity bar. Id.; Bell v. City of Grand Prairie, 160 S.W.3d 691, 695 (Tex. App.-Dallas 2005, no pet.). In some cases, however, dismissal for lack of jurisdiction should be without prejudice. See Thomas v. Long, 2006 WL 1043429 at *5 (Tex. April 21, 2006) (dismissal without prejudice for failure to exhaust administrative remedies). As to the five misdemeanor citations at issue in this appeal, we conclude the jurisdictional defects cannot be remedied. However, we do not address whether some of the hypothetical situations presented may ripen into a justiciable controversy between these parties in the future. We resolve OHBA's fifth issue against it.
We affirm the trial court's judgment.
