I have couple of comboboxes in my project. And their content is changing a lot. So I put their content in my database. Now, I wrote a code like below for retrieving their data but I wonder, is this 'usings' working like my approach or doesn't matter at all? My main question is; is this a healthy way to use objects like this?
DataTable results;
using (results = myDataInteractionClass.SelectDB())
{
// fill table objects to combobox
}
using (results = myDataInteractionClass.SelectAnotherDB())
{
// fill this new table's objects to combobox
}
using (results = myDataInteractionClass.SelectThirdDB())
{
// so goes on like this.
}