vibyvej

vibyvej

  • NA
  • 1
  • 0

Convert ListBox selectedvalue into INT

Feb 28 2005 3:47 PM
Hi! I have a ListBox and I can get the selectedvalue. This selectedvalue is an int ID from an Access table. I have also checked the datatype by: textBox2.Text=ltbxLeft.SelectedValue.GetType().ToString(); It shows: System.Int32 . My problem is that I cann't convert this ltbxLeft.SelectedValue into an integer. such as: int id=int.Parse(ltbxLeft.SelectedValue.ToString()); I got en error message saying: System.FormatException: Input string was not in a correct format. Please help.

Answers (2)