我有一个如下的数组
Dim array() As String = {}
以下是相关代码:
For i = 0 To membertable.Rows.Count - 1
If InStr(membertable.Rows(i)("name"), txtSearch.Text, CompareMethod.Text) - 1 _
<> -1 And txtSearch.Text.Length >= 3 Then
found = True
'add the item that matches the criteria to the array here.
End If
Next i
因此,该代码循环遍历一个Access表的行,并每当找到“名称”列下与我想要添加到数组中的条件匹配的值时,就将该项添加到数组中。数据库项始终为字符串。