Ankita Ankita

Ankita Ankita

  • NA
  • 11
  • 28.1k

unable to cast object of type system.string to type system.data.datarowview

Mar 6 2012 2:24 AM
I m getting this error. Firstly i have bind my list box with a cell in datagrid. when the row is selected the value of cell is is first assigned to a string variable and the that variable is then split near spaces stored in string array and that array is then assigned to list box.

After dat to assign multiple selected items to a label I used foreach loop as
 foreach(datarowview row in listbox.selecteditems)

near datarowview m getting unable to cast object of type system.string to type system.data.datarowview exception.


 

Answers (3)