Still pretty new to programming, but I've got a small sort of schedule app I'm working on and the base functionality is: Drag entries from a datagrid onto a panel, three labels nested in the panel update with relevant text, database is queried and the proper cells in the table are saved.
My big problem comes with loading all of that data from the database and populating all of the labels cleanly in one loop. I know what I need to query from the database to get the data back but as far as presenting it in the UI, I'm hoping to be able to something as simple as tie the counter for the loop to the label names but I'm not sure how I could do that if that's even a thing? For example: If all of my labels are named panel1Title, panel2Title, and so on, I was hoping to do something like this where the name of the label selected increments where I've placed numbers but they increment in unison with the counter:
while (X<=42)
{
panelXTitle.Text = "Title";
}
Is it possible to do what I want to do? If no, what's an alternate direction I should be heading towards to achieve the same results?