Dataset always connected? [Resolved]
I have the code below, adapted from a book, in Sub New() of a form. It's used to populate some textboxes, and works fine (so far). The eventual aim is to have Next and Previous buttons to navigate the dataset.
But I don't see where the connection is ever closed. I'd rather have the dataset retrieve records, close the connection and re-open it for each separate click event. There could be upwards of 20 users at one time, so I don't want a permanent connection.
Should the code be in a stand alone sub, use a static variable, or what? Thanks.