我想从DataTable中获取所有列的值并将其存储到ListBox中。这是我的代码:
If myTableData.Rows.Count > 0 Then
For i As Integer = 0 To myTableData.Rows.Count
Dim DataType() As String = myTableData.Rows(i).Item(1)
ListBox2.Items.AddRange(DataType)
Next
End If
但是当我编译该代码时,我得到了这样的错误消息:
Unable to cast object of type 'System.String' to type 'System.String[]'
那么,如何解决这个问题?请帮助我...