"1维数组String"类型的值无法转换为"String"

1 vb.net arrays

我一直在为学校编写电影搜索的东西,我遇到了这个问题,我不知道如何解决它.

While Not FilmSearcher.EndOfData         'loop until end of file
    currentRow = FilmSearcher.ReadFields()   'read in the fields of each line
    For j = 0 To 3
        Films(i, j) = currentRow(j)      'put the fields into film array
    Next

    i = i + 1
End While
Run Code Online (Sandbox Code Playgroud)

currentRow = FilmSearcher.ReadFields()是无效的部分

Ste*_*eve 6

如果错误消息在你的标题中,那么我打赌你已经宣布currentRow为

Dim currentRow As String
Run Code Online (Sandbox Code Playgroud)

相反,你需要将它声明为一维数组

Dim currentRow() as String
Run Code Online (Sandbox Code Playgroud)