I believe you can view the connectedness requirement like a maximum flow problem.
Introduce a new "supersource" node and a "supersink" node. Denote your candidate for a connected subgraph by $S$. Create an arc connecting the supersource to one of the nodes $x$ in $S$. Create an arc from each node in $S$ to the supersink; each of these arcs should have capacity $1$. Give each arc attached to a node not in $S$ or the supersource or supersink a capacity of $0$.
Then there is total flow of amount $|S|$ from the supersource to the supersink if and only if $S$ is connected. If you can find a total flow of amount $|S|$, the capacities on the arcs to the supersink mean that each flow of one unit must have gone through a different node in $S$ just before reaching the supersink. Since each flow of one unit must also go through $x$, this means that $x$ must be connected to all other nodes in $S$, and so all nodes in $S$ must be connected to each other.
The constraints in the maximum flow problem are nice (just flow-balance, nonnegativity, and capacity constraints), so implementing this shouldn't be too bad. You should also make the total flow being equal to $|S|$ one of the constraints (rather than trying to maximize the flow, so that's how this differs from the maximum flow problem). If you want to include these constraints as part of your overall IP/LP formulation rather than just as a check at the end, you'll need to make sure the flow constraints are active only for the nodes you're considering for your candidate $S$ - probably through some logical (binary) constraints.