title: Split String and add in combobox in c#
body: <p>Im getting a data from a database and adding to combobox.The string contains list of names with comma.</p>
  
  <pre><code>DataRow dr = newdt.Rows[i];
  TraineeCombo.Items.Add(dr["Trainee"].ToString());
  </code></pre>
  
  <p>It works fine but i want to split the string and add each item to combobox. I tried below methods.</p>
  
  <pre><code> DataRow dr = newdt.Rows[i];
   string TempTr = dr["Trainee"].ToString();
   string[] result = TempTr.Split(new Char[] {','});
   foreach (string s in result)
        {
          if (s.Trim() != "")
          TraineeCombo.Items.Add(s);
         }
  </code></pre>
  
  <p>Second method:</p>
  
  <pre><code>String TempTr = dr["Trainee"].ToString();
  TraineeCombo.Items.AddRange(TempTr.Split(','));
  </code></pre>
  
  <p>But both methods shows error as </p>
  
  <p>Cannot convert string to char[] and invalid arguments.
  I got this piece of sample code from msdn.How can i solve it?</p>