Convert ListBox selectedvalue into INT
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.