我的代码有什么问题??
string birthdate = ((DataRowView)comboBox1.SelectedItem).Row["birthdate"].ToString(); //pulled the data into the database ()
string[] split = birthdate.Split('/'); //split the Date
我想把它们放在一个文本框中,所以我想这样做:
textbox1.Text = split[0]; //correct, gets the 1st word the (Day)
textbox2.Text = split[1]; //incorrect, outofrange exception (Month)
textbox3.Text = split[2]; //incorrect, outforange exception (Year)
注意:格式为日/月(字)/年 ==> 1/January/2012
有人可以帮我获取这些值并将它们一一放入文本框中吗?