This is Nagarjuna working as a .net developer.I am facing a problem in C# windows form.My problem was
Actually in my database one filed value is '12Years'.I have to retrieve that value to my windows form like '12' value in one textbox and 'Years' to combobox. I am enable to solve that.So,any one plz resolve it.
Thanks & Regards
Nagarjuna Naidu
7 Seas IT Services

Dorababu MekaRank #457 · 5.5K reputationPosted Jan 16, 2013, 1:12 AM EST
string Number= Regex.Match(yourdbcolumn, @"\d+").Value;
As per your requirement
string strYears = "12Years";
string[] strArray = Regex.Matches(strYears, @"[a-zA-Z]+|\d+").Cast
textBox1.Text = strArray[0].ToString();
comboBox1.Items.Add(strArray[1].ToString());
comboBox1.SelectedIndex = 0;