3
Answers

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

Ankita Ankita

Ankita Ankita

12y
5.8k
1
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)