Sunday, July 27, 2008

Extracting string through comma separator in C#

Separating the given string into commas and adding them to dropdownlist.


string Months = TextBox1.Text;
string[] ind = Months.Split(new char[]{','});
foreach(string m in ind)
{

DropDownList1.Items.Add(m.ToString());



}