比较数据行中的值 VB

comparing values in a datarow VB

我想比较两个数据行 row 和 row1 中的值。但是此代码正在生成错误

For Each row As DataRow In dt.Rows
    For Each row1 As DataRow In tmpdt.Rows
        If row["STATE"].Tostring() = row1["STATE"].Tostring() Then

        End If
    Next
Next

错误:

Value of type 'System.Data.DataRow' cannot be converted to 'Boolean'

使用圆括号 () 代替 []

这可行:

For Each row As DataRow In dt.Rows
    For Each row1 As DataRow In tmpdt.Rows
        If row("STATE").Tostring() = row1("STATE").Tostring() Then

        End If
    Next
Next