Handling the comma. Period.
One of my favorite words for as long as I can remember is "minutia" (or "minutiae" plural.) My blog is filled with minutiae, and would have been more aptly titled ".NET Minutiae and Very Little Else." That title might be taken, of course...
I'm not obsessed with economic code, but I like to write about it when it happens. Kind of like when my dog scares up a wild turkey from out of some brush during our lunchtime walks. I tell you about that, but I don't want to take focus off the comma.
Traditionally the approach would be something like
string comma = ", ";
int i = 0;
while (dr.Read())
{
if (i==0)
user_names += dr["user"].ToString();
else
user_names += comma + dr["user"].ToString();
i++;
}
but the new and improved version is
string comma = "";
while (dr.Read())
{
team_uids += comma + dr["uid"].ToString();
comma = ", ";
}
Now some stud will show me how this can be improved. Always happens (which is pretty darn cool!), so check the comments in 24.