title: How to convert table format to string programmatically
body: <p>Good day all,</p>
  
  <p>would like request to how to convert table format to string</p>
  
  <p>eg: </p>
  
  <pre><code>Material Control     August
  Development         September
  Planning            August
  HR                  September
  </code></pre>
  
  <p>to</p>
  
  <p><strong>Septembe</strong>r: Development, HR<br>
  <strong>August</strong> : Material Control, Planning </p>
  
  <pre><code>            List&lt;String&gt; returnvalueStringMonth = new List&lt;String&gt;();
              List&lt;String&gt; returnvalueStringDept = new List&lt;String&gt;();
              foreach (DataRow dr in dsSeries.Tables[0].Rows)
              {
                  string newmanout = dr["MonthNames"].ToString();
                  returnvalueStringMonth.Add(newmanout);
  
                  string Departs = dr["Depart"].ToString();
                  returnvalueStringMonth.Add(Departs);
                  //var DDLName = dr["Depart"];
                  //Label dynamicLabel = new Label();
                  //dynamicLabel.Text = DDLName.ToString() + ",";
                  //div1.Controls.Add(dynamicLabel);
                  //var sumPlus = Convert.ToDouble(newmanout) +",";
  
              }
  
              List&lt;string&gt; b = new List&lt;string&gt;();
              b.AddRange(returnvalueStringMonth.Distinct());
              for (int cs = 0; cs &lt; b.Count; cs++)
              {
                  //Panel aspPanel = new Panel();
                  Label dynamicLabel = new Label();
                  dynamicLabel.Text = b[cs].ToString()+":" + "&lt;br/&gt;";
                  div1.Controls.Add(dynamicLabel);
              }
  </code></pre>
  
  <p>I able achive until month only, then i realize made mistake.
  So, please advise how to achive this.</p>