Question: I have a Navigation Controller in my main view. And I use the following code to add the navigation view when needed.

[self.view addSubview:navController.view];

However, the the navigation bar is not positioned correctly. I have posted a pic below. Anyone knows what is the potential problem?

![alt text](https://i.stack.imgur.com/jxZ7J.png)

Answer: 
Simply put all invoice nos in a IN statement and run this select statement in a single connection.
I'm missing the `conn.Close()` inside your try-block.

If it is really missing, that could be your problem: You keep making new connections all the time. So, **close it**, in a try/finally block. 

But if this was a typo in the posted code, then I don't think your problem is related to the Connection(s), ADO.NET uses ConnectionPooling so you are keeping the 'real' connection open, even when you say conn.Close(). 

The other issue would be doing a Query for every invoice. That is expensive too. But since you seem to use a SP it's not so easy to overcome. What would be useful here is a SELECT statement that ends with `WHERE Id IN (a, b, c, d)`. This would allow you to batch invoices (get 5 or 20 with 1 query.