我在后台使用vb.net和MS Access作为数据库。我得到“列”ColumnName“不属于表”下面是我的代码:
Dim comp As String
Dim i As Integer = 1
For Each row As DataRow In crossTable.Rows
For Each r As DataRow In pptTable.Rows
Dim l As Label = CType(Me.Controls("lbl" & i), Label)
Dim c As ComboBox = CType(Me.Controls("cbo" & i), ComboBox)
If c.Text <> "" Then
'Get the cell value at this row for the l.text columnname
comp = row("'" & l.Text & "'")
If c.Text <> comp Then
row.Delete()
End If
End If
i += 1
Next
Next
我有两个数据表我正在循环,当我到达comp = row(“'”&amp; l.Text&amp;“'”)时,它给了我这个错误。我已经多次调试了,而且我的crosstable具有所有正确的列名和值,那么为什么在那一行它不能识别该列名?非常感谢任何帮助。