私のコードに何の問題がありますか?私はテキストボックスに入れたいIndexOutofRangeException Winform
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/1月/ 2012
誰かが値を取得してテキストボックスに1つずつ入れることができますか?
「string」の誕生日には何が含まれていますか?それは非データバインドコンボボックスを使用して私のために働いています。 –
生年月日は私のデータベースのVarcharです。そうです!なぜ私はエラーが発生しているのか分かりません。 T_T –