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 MekaPosted Jan 16, 2013, 6:12 AM
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;