Is it possible to perform a SQL SELECT Statement that will select all rows, then output the rows to a label, which is created dynamically?
In the system I'm writing (pretty new to c#) I am performing a SQL SELECT from a view where a records ID can appear multiple times, but with different associated values, i.e.
ID - VALUE
1 - A
1 - B
1 - C
2 - A
2 - B
3 - A
What I want to do then is output each result to a its own label, but i would have no idea until the SELECT is ran how many labels I would need so I'd need code to draw them dynamically? Using the above examples A would return 3 labels, but B would only return 2.
If that makes any sense? E.G
foreach (result in sql)
{
label.Text = result
}
Thanks