我说我想使用此方法返回一些数组
Function getKategori() As String()
Dim a As String() = {}
Try
connection.Open()
Dim myCommand As New MySqlCommand
myCommand.Connection = connection
myCommand.CommandText = "SELECT * FROM kategori"
myAdapter.SelectCommand = myCommand
reader = myCommand.ExecuteReader
While reader.Read()
a = {reader(0).ToString, reader(1).ToString}
End While
Catch ex As Exception
End Try
Return a
End Function
应该像这样返回
{{a,b},{a,b}}
等,我想通过使用foreach方法将该结果用于组合框
For Each k In x.getKategori()
'?some function to add these items into combobox?
Next
我应该怎么做?